Add draw_shape and draw_shapes with tests

draw_shape turns 360 divided by the number of sides after each side and rejects
fewer than 3 sides. draw_shapes draws a triangle up to a decagon, each in a color
from the palette.

Task: MIL-003#3
Task: MIL-003#4
Task: MIL-003#5
This commit is contained in:
2026-10-07 23:59:05 +08:00
parent 9318a07fa0
commit 32861fc58f
5 changed files with 173 additions and 2 deletions
+6 -2
View File
@@ -3,17 +3,21 @@
@brief Solutions to the turtle graphics challenges of day 18 of Udemy's
100 Days of Code.
The challenges so far are @ref turtle_challenges.square.draw_square and
@ref turtle_challenges.dashed_line.draw_dashed_line. Each takes the turtle as its
The challenges so far are @ref turtle_challenges.square.draw_square,
@ref turtle_challenges.dashed_line.draw_dashed_line and
@ref turtle_challenges.shapes.draw_shape. Each takes the turtle as its
first argument, so it can be tested without a window.
"""
from turtle_challenges.colors import random_color, random_palette_color
from turtle_challenges.dashed_line import draw_dashed_line
from turtle_challenges.shapes import draw_shape, draw_shapes
from turtle_challenges.square import draw_square
__all__ = [
"draw_dashed_line",
"draw_shape",
"draw_shapes",
"draw_square",
"random_color",
"random_palette_color",