Files
018-turtle/src/turtle_challenges/__init__.py
T
Tirsvad 2328490945 Add draw_spirograph with tests
Draws int(360 / size_of_gap) circles, each in a random RGB color, turning the heading
by the gap after each. A gap that is not positive raises ValueError, and the integer
count avoids the TypeError that range raises for a float.

Task: MIL-004#2
Task: MIL-004#3
2026-10-07 23:59:12 +08:00

31 lines
1003 B
Python

"""!
@file __init__.py
@brief Solutions to the turtle graphics challenges of day 18 of Udemy's
100 Days of Code.
The five challenges are @ref turtle_challenges.square.draw_square,
@ref turtle_challenges.dashed_line.draw_dashed_line,
@ref turtle_challenges.shapes.draw_shape,
@ref turtle_challenges.random_walk.random_walk and
@ref turtle_challenges.spirograph.draw_spirograph. 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.random_walk import random_walk
from turtle_challenges.shapes import draw_shape, draw_shapes
from turtle_challenges.spirograph import draw_spirograph
from turtle_challenges.square import draw_square
__all__ = [
"draw_dashed_line",
"draw_shape",
"draw_shapes",
"draw_spirograph",
"draw_square",
"random_color",
"random_palette_color",
"random_walk",
]