{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "1453e033",
   "metadata": {},
   "source": [
    "# 10-20 · Сетка фигур\n",
    "\n",
    "Практика к разделу [«Сетка фигур: вложенные циклы в Turtle»](../../site/chapters/glava-10/10-15-setka-figur.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b528cf43",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Применить вложенные циклы «строки × столбцы» к настоящей графике."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1383bf41",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "91193809",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T20:15:54.874167Z",
     "iopub.status.busy": "2026-08-16T20:15:54.874034Z",
     "iopub.status.idle": "2026-08-16T20:15:55.041085Z",
     "shell.execute_reply": "2026-08-16T20:15:55.040395Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Окно Turtle готово.\n"
     ]
    }
   ],
   "source": [
    "import turtle\n",
    "\n",
    "screen = turtle.Screen()\n",
    "artist = turtle.Turtle()\n",
    "artist.speed(0)\n",
    "print(\"Окно Turtle готово.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "49bd52af",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3ff1c8a3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T20:15:55.042405Z",
     "iopub.status.busy": "2026-08-16T20:15:55.042197Z",
     "iopub.status.idle": "2026-08-16T20:15:58.671993Z",
     "shell.execute_reply": "2026-08-16T20:15:58.671296Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Сетка готова.\n"
     ]
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.hideturtle()\n",
    "artist.penup()\n",
    "shag = 60\n",
    "\n",
    "for row in range(5):\n",
    "    for col in range(5):\n",
    "        x = -140 + col * shag\n",
    "        y = -140 + row * shag\n",
    "        artist.goto(x, y)\n",
    "        artist.dot(16, \"#5B24F9\")\n",
    "print(\"Сетка готова.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b5164049",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7d81fca8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T20:15:58.673029Z",
     "iopub.status.busy": "2026-08-16T20:15:58.672912Z",
     "iopub.status.idle": "2026-08-16T20:15:58.676279Z",
     "shell.execute_reply": "2026-08-16T20:15:58.675801Z"
    }
   },
   "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
}
