{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6f8f6127",
   "metadata": {},
   "source": [
    "# 07-21 · Часы без времени\n",
    "\n",
    "Практика к разделу [«Мини-проект: часы без времени»](../../site/chapters/glava-07/07-21-mini-proekt-chasy.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35cc39d1",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Построить статичный циферблат из делений и стрелок."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4b39ced",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8e85af2e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:57.456580Z",
     "iopub.status.busy": "2026-08-16T15:16:57.456482Z",
     "iopub.status.idle": "2026-08-16T15:16:57.630364Z",
     "shell.execute_reply": "2026-08-16T15:16:57.629948Z"
    }
   },
   "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": "291651ab",
   "metadata": {},
   "source": [
    "## Рабочий пример\n",
    "\n",
    "Окружность и 12 делений."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2f850a2d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:57.631549Z",
     "iopub.status.busy": "2026-08-16T15:16:57.631441Z",
     "iopub.status.idle": "2026-08-16T15:17:02.991534Z",
     "shell.execute_reply": "2026-08-16T15:17:02.991025Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.circle(120)\n",
    "for hour in range(12):\n",
    "    artist.penup()\n",
    "    artist.goto(0, 0)\n",
    "    artist.setheading(90 - hour * 30)\n",
    "    artist.forward(105)\n",
    "    artist.pendown()\n",
    "    artist.forward(15)\n",
    "    artist.penup()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0bd3fb89",
   "metadata": {},
   "source": [
    "## Задание ★★ Самостоятельная практика\n",
    "\n",
    "Добавьте часовую стрелку (толстая, короткая) на 9 часов и минутную (тоньше, длиннее) на 12 часов."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d11c692f",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:17:02.992812Z",
     "iopub.status.busy": "2026-08-16T15:17:02.992708Z",
     "iopub.status.idle": "2026-08-16T15:17:03.603760Z",
     "shell.execute_reply": "2026-08-16T15:17:03.603371Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.pensize(5)\n",
    "artist.pencolor(\"#5B24F9\")\n",
    "artist.goto(0, 0)\n",
    "artist.setheading(90 - 9 * 30)\n",
    "artist.pendown()\n",
    "artist.forward(70)\n",
    "artist.penup()\n",
    "\n",
    "artist.pensize(3)\n",
    "artist.pencolor(\"#DB2777\")\n",
    "artist.goto(0, 0)\n",
    "artist.setheading(90 - 12 * 30)\n",
    "artist.pendown()\n",
    "artist.forward(95)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac797d0c",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0fea3237",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:17:03.605204Z",
     "iopub.status.busy": "2026-08-16T15:17:03.605096Z",
     "iopub.status.idle": "2026-08-16T15:17:03.608442Z",
     "shell.execute_reply": "2026-08-16T15:17:03.607960Z"
    }
   },
   "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
}
