From 53750760cd49f5582b2f15797a01667a3fe49e79 Mon Sep 17 00:00:00 2001 From: vlitvintseva <24_LitvintsevaVD@iux.local> Date: Wed, 18 Mar 2026 12:35:54 +0300 Subject: [PATCH] 1 --- rabit2.py | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/rabit2.py b/rabit2.py index 21f1695..0b6f2d6 100755 --- a/rabit2.py +++ b/rabit2.py @@ -31,31 +31,27 @@ def draw_hare(surface, x, y, width, height, color): ear_height = height // 3 ear_y = y - height // 2 + ear_height // 2 - for ear_x in (x - head_size // 4, x + head_size // 4): - draw_ear(surface, ear_x, ear_y, width // 8, ear_height, color) + draw_ear(surface, x - head_size // 4, ear_y, width // 8, ear_height, color) + draw_ear(surface, x + head_size // 4, ear_y, width // 8, ear_height, color) leg_height = height // 16 leg_y = y + height // 2 - leg_height // 2 - for leg_x in (x - width // 4, x + width // 4): - draw_leg(surface, leg_x, leg_y, width // 4, leg_height, color) + draw_leg(surface, x - width // 4, leg_y, width // 4, leg_height, color) + draw_leg(surface, x + width // 4, leg_y, width // 4, leg_height, color) - # Глаза (белки) eye_y = head_y - head_size // 8 eye_radius = head_size // 8 - for eye_x in (x - head_size // 6, x + head_size // 6): - circle(surface, (255, 255, 255), (eye_x, eye_y), eye_radius) + circle(surface, (255, 255, 255), (x - head_size // 6, eye_y), eye_radius) + circle(surface, (255, 255, 255), (x + head_size // 6, eye_y), eye_radius) - # Зрачки pupil_radius = eye_radius // 2 - for pupil_x in (x - head_size // 6, x + head_size // 6): - circle(surface, (0, 0, 0), (pupil_x, eye_y), pupil_radius) + circle(surface, (0, 0, 0), (x - head_size // 6, eye_y), pupil_radius) + circle(surface, (0, 0, 0), (x + head_size // 6, eye_y), pupil_radius) - # Блики в глазах spark_radius = pupil_radius // 3 - for spark_x in (x - head_size // 6 - 2, x + head_size // 6 - 2): - circle(surface, (255, 255, 255), (spark_x, eye_y - 2), spark_radius) + circle(surface, (255, 255, 255), (x - head_size // 6 - 2, eye_y - 2), spark_radius) + circle(surface, (255, 255, 255), (x + head_size // 6 - 2, eye_y - 2), spark_radius) - # Носик (розовый треугольник) nose_y = head_y + head_size // 8 polygon(surface, (255, 150, 150), [ (x, nose_y), @@ -63,40 +59,44 @@ def draw_hare(surface, x, y, width, height, color): (x + head_size // 8, nose_y + head_size // 12) ]) - # Ротик line(surface, (150, 100, 100), (x, nose_y + head_size // 16), (x, nose_y + head_size // 8), 2) - # Немного румянца на щечках blush_radius = head_size // 10 - for cheek_x in (x - head_size // 4, x + head_size // 4): - circle(surface, (255, 200, 200), (cheek_x, nose_y + head_size // 24), blush_radius) + circle(surface, (255, 200, 200), (x - head_size // 4, nose_y + head_size // 24), blush_radius) + circle(surface, (255, 200, 200), (x + head_size // 4, nose_y + head_size // 24), blush_radius) - # Усики whisker_y = nose_y + head_size // 24 whisker_length = head_size // 4 - for i in range(3): - # Левые усики - line(surface, (100, 100, 100), - (x - head_size // 10, whisker_y + i * 2), - (x - whisker_length - head_size // 10, whisker_y - head_size // 10 + i * 2), 1) - # Правые усики - line(surface, (100, 100, 100), - (x + head_size // 10, whisker_y + i * 2), - (x + whisker_length + head_size // 10, whisker_y - head_size // 10 + i * 2), 1) + + line(surface, (100, 100, 100), + (x - head_size // 10, whisker_y), + (x - whisker_length - head_size // 10, whisker_y - head_size // 10), 1) + line(surface, (100, 100, 100), + (x - head_size // 10, whisker_y + 2), + (x - whisker_length - head_size // 10, whisker_y - head_size // 10 + 2), 1) + line(surface, (100, 100, 100), + (x - head_size // 10, whisker_y + 4), + (x - whisker_length - head_size // 10, whisker_y - head_size // 10 + 4), 1) + + line(surface, (100, 100, 100), + (x + head_size // 10, whisker_y), + (x + whisker_length + head_size // 10, whisker_y - head_size // 10), 1) + line(surface, (100, 100, 100), + (x + head_size // 10, whisker_y + 2), + (x + whisker_length + head_size // 10, whisker_y - head_size // 10 + 2), 1) + line(surface, (100, 100, 100), + (x + head_size // 10, whisker_y + 4), + (x + whisker_length + head_size // 10, whisker_y - head_size // 10 + 4), 1) - # Передние лапки (две маленькие) - с обводкой front_leg_width = width // 12 front_leg_height = height // 8 front_leg_y = y + height // 6 - # Левая передняя лапка (с обводкой) ellipse(surface, (0, 0, 0), (x - width // 6 - front_leg_width // 2, front_leg_y - front_leg_height // 2, front_leg_width, front_leg_height), 1) - - # Правая передняя лапка (с обводкой) ellipse(surface, (0, 0, 0), (x + width // 6 - front_leg_width // 2, front_leg_y - front_leg_height // 2, front_leg_width, front_leg_height), 1)