{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1734dc82",
   "metadata": {},
   "source": [
    "# 06-11 · Pierwsze liczby i wzór 360/n\n",
    "\n",
    "Praktyka do sekcji [„Pierwsze liczby i Formuła 360/n”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c8df0fcb",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Zastosuj wzór obrotu 360/n do różnych wielokątów."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ee42d2b",
   "metadata": {},
   "source": [
    "## Ustawienie (wykonać raz)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c7ccbf9c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:11.122753Z",
     "iopub.status.busy": "2026-08-16T13:58:11.122651Z",
     "iopub.status.idle": "2026-08-16T13:58:11.302035Z",
     "shell.execute_reply": "2026-08-16T13:58:11.301667Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Окно Turtle готово.\n"
     ]
    }
   ],
   "source": [
    "import turtle\n",
    "\n",
    "screen = turtle.Screen()\n",
    "artist = turtle.Turtle()\n",
    "artist.pensize(3)\n",
    "artist.pencolor(\"#5B24F9\")\n",
    "print(\"Окно Turtle готово.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a337b33c",
   "metadata": {},
   "source": [
    "## Sprawa robocza\n",
    "\n",
    "Trójkąt – obrót 360/3 = 120°."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6067c312",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:11.303257Z",
     "iopub.status.busy": "2026-08-16T13:58:11.303141Z",
     "iopub.status.idle": "2026-08-16T13:58:12.082551Z",
     "shell.execute_reply": "2026-08-16T13:58:12.081926Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "for _ in range(3):\n",
    "    artist.forward(100)\n",
    "    artist.right(120)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a060809",
   "metadata": {},
   "source": [
    "## Eksperyment 1\n",
    "\n",
    "Przewiduj kąt obrotu ośmiokąta (n=8), a następnie sprawdź."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "39d7fb87",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:12.083712Z",
     "iopub.status.busy": "2026-08-16T13:58:12.083599Z",
     "iopub.status.idle": "2026-08-16T13:58:13.199922Z",
     "shell.execute_reply": "2026-08-16T13:58:13.199495Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "povorot = 360 / 8\n",
    "for _ in range(8):\n",
    "    artist.forward(60)\n",
    "    artist.right(povorot)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8f12039a",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★\n",
    "\n",
    "Narysuj poprawny dziesięciokąt (n=10), obliczając kąt obrotu według wzoru 360/n (nie wpisuj liczby ręcznie)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c16bb72b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:13.201161Z",
     "iopub.status.busy": "2026-08-16T13:58:13.201058Z",
     "iopub.status.idle": "2026-08-16T13:58:14.377107Z",
     "shell.execute_reply": "2026-08-16T13:58:14.376780Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "n = 10\n",
    "povorot = 360 / n\n",
    "for _ in range(n):\n",
    "    artist.forward(50)\n",
    "    artist.right(povorot)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26c5096b",
   "metadata": {},
   "source": [
    "## Ukończenie (wykonaj raz, na samym końcu)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7b4f666a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:14.378431Z",
     "iopub.status.busy": "2026-08-16T13:58:14.378327Z",
     "iopub.status.idle": "2026-08-16T13:58:14.381450Z",
     "shell.execute_reply": "2026-08-16T13:58:14.380974Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Окно Turtle закрыто.\n"
     ]
    }
   ],
   "source": [
    "screen.bye()\n",
    "print(\"Окно Turtle закрыто.\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
