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
This commit is contained in:
2026-10-07 23:59:12 +08:00
parent 949d2edb63
commit 2328490945
4 changed files with 170 additions and 3 deletions
+6
View File
@@ -77,6 +77,12 @@ WALK_PEN_SIZE = 10
## Challenge 4: headings of a step: east, north, west and south, in degrees.
WALK_HEADINGS: tuple[int, ...] = (0, 90, 180, 270)
## Challenge 5: radius of every circle of the spirograph, in turtle units.
SPIROGRAPH_RADIUS = 100
## Challenge 5: degrees the heading turns after each circle.
SPIROGRAPH_GAP_DEGREES = 5
## Command line name of challenge 1.
CHALLENGE_SQUARE = "square"