{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "4b32b5a0",
   "metadata": {},
   "source": [
    "# 06-14 · Заливка, круг, дуга и точка\n",
    "\n",
    "Практика к разделу [«Заливка, круг, дуга и точка»](../../site/chapters/glava-06/06-14-zalivka-krug-tochka.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ca23a6c8",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Освоить begin_fill()/end_fill(), circle() и dot()."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4d2eb53b",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7a34ea17",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:18.181113Z",
     "iopub.status.busy": "2026-08-16T13:58:18.180993Z",
     "iopub.status.idle": "2026-08-16T13:58:18.359042Z",
     "shell.execute_reply": "2026-08-16T13:58:18.358566Z"
    }
   },
   "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": "73d4bbfe",
   "metadata": {},
   "source": [
    "## Рабочий пример\n",
    "\n",
    "Закрашенный квадрат."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a8176095",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:18.360335Z",
     "iopub.status.busy": "2026-08-16T13:58:18.360220Z",
     "iopub.status.idle": "2026-08-16T13:58:19.293033Z",
     "shell.execute_reply": "2026-08-16T13:58:19.292454Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.fillcolor(\"#B9A0FC\")\n",
    "artist.begin_fill()\n",
    "for _ in range(4):\n",
    "    artist.forward(100)\n",
    "    artist.right(90)\n",
    "artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "825de74d",
   "metadata": {},
   "source": [
    "## Эксперимент 1\n",
    "\n",
    "Нарисуйте окружность радиусом 60, затем половину окружности (extent=180) рядом."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d7ae2d91",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:19.294141Z",
     "iopub.status.busy": "2026-08-16T13:58:19.294038Z",
     "iopub.status.idle": "2026-08-16T13:58:21.283907Z",
     "shell.execute_reply": "2026-08-16T13:58:21.283253Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.circle(60)\n",
    "artist.penup()\n",
    "artist.forward(150)\n",
    "artist.pendown()\n",
    "artist.circle(60, 180)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1902c73c",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Нарисуйте закрашенный круг радиусом 50 (fillcolor любой на ваш выбор)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "287a8d86",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:21.284897Z",
     "iopub.status.busy": "2026-08-16T13:58:21.284788Z",
     "iopub.status.idle": "2026-08-16T13:58:22.428532Z",
     "shell.execute_reply": "2026-08-16T13:58:22.427943Z"
    }
   },
   "outputs": [],
   "source": [
    "artist.reset()\n",
    "artist.fillcolor(\"#DB2777\")\n",
    "artist.begin_fill()\n",
    "artist.circle(50)\n",
    "artist.end_fill()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8b1354fa",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "aa71657a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T13:58:22.429665Z",
     "iopub.status.busy": "2026-08-16T13:58:22.429552Z",
     "iopub.status.idle": "2026-08-16T13:58:22.432479Z",
     "shell.execute_reply": "2026-08-16T13:58:22.431977Z"
    }
   },
   "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
}
