{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "caf91958",
   "metadata": {},
   "source": [
    "# 07-17 · Черепашка как графический объект\n",
    "\n",
    "Практика к разделу [«Черепашка как графический объект»](../../site/chapters/glava-07/07-17-forma-cherepashki.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "11452fec",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Освоить shape(), shapesize() и tilt()."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "134468a5",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f6b958a5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:50.757683Z",
     "iopub.status.busy": "2026-08-16T15:16:50.757575Z",
     "iopub.status.idle": "2026-08-16T15:16:50.940442Z",
     "shell.execute_reply": "2026-08-16T15:16:50.939759Z"
    }
   },
   "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": "6dd2add5",
   "metadata": {},
   "source": [
    "## Рабочий пример\n",
    "\n",
    "Увеличенная форма-черепашка."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9d6e8f6b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:50.941769Z",
     "iopub.status.busy": "2026-08-16T15:16:50.941603Z",
     "iopub.status.idle": "2026-08-16T15:16:50.987462Z",
     "shell.execute_reply": "2026-08-16T15:16:50.987024Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.shape(\"turtle\")\n",
    "artist.shapesize(2, 2)\n",
    "artist.stamp()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec8736a2",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Поставьте штамп формы \"square\" с shapesize(1.5, 3) — растянутый прямоугольник."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "73d0fbe1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:50.988580Z",
     "iopub.status.busy": "2026-08-16T15:16:50.988475Z",
     "iopub.status.idle": "2026-08-16T15:16:51.034236Z",
     "shell.execute_reply": "2026-08-16T15:16:51.033788Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.shape(\"square\")\n",
    "artist.shapesize(1.5, 3)\n",
    "artist.stamp()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dd64669a",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "cb781165",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-16T15:16:51.035208Z",
     "iopub.status.busy": "2026-08-16T15:16:51.035104Z",
     "iopub.status.idle": "2026-08-16T15:16:51.038057Z",
     "shell.execute_reply": "2026-08-16T15:16:51.037602Z"
    }
   },
   "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
}
