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
+4
View File
@@ -9,6 +9,10 @@ def test_challenge_names_are_unique() -> None:
assert len(set(constants.CHALLENGE_NAMES)) == len(constants.CHALLENGE_NAMES)
def test_walk_headings_are_the_four_compass_directions() -> None:
assert constants.WALK_HEADINGS == (0, 90, 180, 270)
def test_palette_has_only_non_empty_names() -> None:
assert constants.COLOR_PALETTE
assert all(name for name in constants.COLOR_PALETTE)