{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8a10b7ce",
   "metadata": {},
   "source": [
    "# 06-18 · Мини-проекты\n",
    "\n",
    "Практика к разделу [«Мини-проекты»](../../site/chapters/glava-06/06-18-mini-proekty.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "20474b52",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Собрать несколько приёмов главы в одной законченной картинке."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0017665a",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d95380f1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:36.600735Z",
     "iopub.status.busy": "2026-08-16T13:58:36.600636Z",
     "iopub.status.idle": "2026-08-16T13:58:36.775444Z",
     "shell.execute_reply": "2026-08-16T13:58:36.774859Z"
    }
   },
   "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": "50b2b602",
   "metadata": {},
   "source": [
    "## Рабочий пример\n",
    "\n",
    "Простая мишень из двух колец."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3e3149aa",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:36.777320Z",
     "iopub.status.busy": "2026-08-16T13:58:36.777146Z",
     "iopub.status.idle": "2026-08-16T13:58:38.957321Z",
     "shell.execute_reply": "2026-08-16T13:58:38.956741Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "for radius, color in [(60, \"#DC2626\"), (30, \"#FAFAFC\")]:\n",
    "    artist.penup()\n",
    "    artist.goto(0, -radius)\n",
    "    artist.pendown()\n",
    "    artist.fillcolor(color)\n",
    "    artist.begin_fill()\n",
    "    artist.circle(radius)\n",
    "    artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9596203a",
   "metadata": {},
   "source": [
    "## Задание ★★ Самостоятельная практика\n",
    "\n",
    "Нарисуйте свою мишень из трёх колец радиусами 80, 55, 30 с чередующимися цветами по вашему выбору."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "77e4abec",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:38.958888Z",
     "iopub.status.busy": "2026-08-16T13:58:38.958760Z",
     "iopub.status.idle": "2026-08-16T13:58:42.535683Z",
     "shell.execute_reply": "2026-08-16T13:58:42.535049Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "for radius, color in [(80, \"#2563EB\"), (55, \"#FAFAFC\"), (30, \"#2563EB\")]:\n",
    "    artist.penup()\n",
    "    artist.goto(0, -radius)\n",
    "    artist.pendown()\n",
    "    artist.fillcolor(color)\n",
    "    artist.begin_fill()\n",
    "    artist.circle(radius)\n",
    "    artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ca9cf4dd",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7ed665da",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:42.536957Z",
     "iopub.status.busy": "2026-08-16T13:58:42.536847Z",
     "iopub.status.idle": "2026-08-16T13:58:42.539726Z",
     "shell.execute_reply": "2026-08-16T13:58:42.539305Z"
    }
   },
   "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
}
