Add random_walk with tests

200 steps of equal length, each in a random heading of 0, 90, 180 or 270 degrees and
a random RGB color, with a thick line and the fastest speed.

Task: MIL-004#1
This commit is contained in:
2026-10-07 23:59:10 +08:00
parent c695c47929
commit 949d2edb63
5 changed files with 183 additions and 2 deletions
+5 -2
View File
@@ -4,13 +4,15 @@
100 Days of Code.
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
@ref turtle_challenges.dashed_line.draw_dashed_line,
@ref turtle_challenges.shapes.draw_shape and
@ref turtle_challenges.random_walk.random_walk. 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.square import draw_square
@@ -21,4 +23,5 @@ __all__ = [
"draw_square",
"random_color",
"random_palette_color",
"random_walk",
]