{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "93ff004e",
   "metadata": {},
   "source": [
    "# 07-06 · Текст на экране\n",
    "\n",
    "Практика к разделу [«Рисуем текст на экране»](../../site/chapters/glava-07/07-06-tekst-na-ekrane.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4ae4a511",
   "metadata": {},
   "source": [
    "## Цель\n",
    "\n",
    "Выводить текст на холсте Turtle командой write()."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f9ce203b",
   "metadata": {},
   "source": [
    "## Настройка (выполнить один раз)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "28be9d4a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:53:30.892301Z",
     "iopub.status.busy": "2026-08-14T20:53:30.892164Z",
     "iopub.status.idle": "2026-08-14T20:53:31.066895Z",
     "shell.execute_reply": "2026-08-14T20:53:31.066465Z"
    }
   },
   "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": "a200a8df",
   "metadata": {},
   "source": [
    "## Рабочий пример"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "de47fd4a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:53:31.068003Z",
     "iopub.status.busy": "2026-08-14T20:53:31.067828Z",
     "iopub.status.idle": "2026-08-14T20:53:31.141560Z",
     "shell.execute_reply": "2026-08-14T20:53:31.140724Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Текст нарисован.\n"
     ]
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.write(\"Привет, Turtle!\", font=(\"Arial\", 20, \"normal\"))\n",
    "print(\"Текст нарисован.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d2b2b225",
   "metadata": {},
   "source": [
    "## Эксперимент 1\n",
    "\n",
    "Попробуйте выравнивание по центру и полужирное начертание."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "1fbe6787",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:53:31.147168Z",
     "iopub.status.busy": "2026-08-14T20:53:31.146692Z",
     "iopub.status.idle": "2026-08-14T20:53:31.232001Z",
     "shell.execute_reply": "2026-08-14T20:53:31.231166Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Готово.\n"
     ]
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.write(\"По центру\", align=\"center\", font=(\"Arial\", 24, \"bold\"))\n",
    "print(\"Готово.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "110a013b",
   "metadata": {},
   "source": [
    "## Задание ★ Базовая практика\n",
    "\n",
    "Выведите своё имя большим курсивным шрифтом в верхней части экрана."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "581a195a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:53:31.234861Z",
     "iopub.status.busy": "2026-08-14T20:53:31.234673Z",
     "iopub.status.idle": "2026-08-14T20:53:31.377389Z",
     "shell.execute_reply": "2026-08-14T20:53:31.376975Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Готово.\n"
     ]
    }
   ],
   "source": [
    "artist.reset()\n",
    "artist.penup()\n",
    "artist.goto(0, 100)\n",
    "artist.write(\"Cartesian\", align=\"center\", font=(\"Arial\", 28, \"italic\"))\n",
    "print(\"Готово.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1350b3e7",
   "metadata": {},
   "source": [
    "## Завершение (выполнить один раз, в самом конце)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5bb8a0c5",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-14T20:53:31.378622Z",
     "iopub.status.busy": "2026-08-14T20:53:31.378505Z",
     "iopub.status.idle": "2026-08-14T20:53:31.382044Z",
     "shell.execute_reply": "2026-08-14T20:53:31.381646Z"
    }
   },
   "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
}
