Commit Graph
4 Commits
Author SHA1 Message Date
Tirsvad ab92d5871c Adopt the Food class and its tests
Copied unchanged from the base: class Food(Turtle) with refresh, and one random_coordinate function that the tests replace. MIL-003 checks the values against the day-21 lectures.

Task: MIL-002#3
Closes #10
2026-10-08 18:31:04 +08:00
Tirsvad 73fdc2026f Adopt the Snake class and its tests
Copied unchanged from the base: create_snake, add_segment, extend, move, hits_wall, hits_tail, up, down, left and right, with the segments list and the head. The tail check loops over the slice segments[1:]. snake.py does not import turtle until a real segment is made.

Task: MIL-002#2
Closes #9
2026-10-08 18:31:03 +08:00
Tirsvad 5575658503 Adopt the test fakes
Copied unchanged from the base (020-snake-game, commit 1a638c9): the fake segment, the fake screen and the fake Turtle base class that record their calls, so every test runs without a display. The fake turtle module is installed with monkeypatch, so it is undone after each test.

Task: MIL-002#1
Closes #8
2026-10-08 18:31:01 +08:00
Tirsvad 6f196f0f79 Adopt constants.py and its test
Copied from the base with identity-only edits: the docstrings name days 20 and 21, and the package main page describes the whole game. The values are unchanged; MIL-003 checks them against the day-21 lectures.

Task: MIL-001#3
Closes #3
2026-10-08 17:46:40 +08:00