Adopt the Snake class and its tests #9

Closed
opened 2026-10-08 11:05:15 +02:00 by Tirsvad · 0 comments
Owner

Copy src/snake_game/snake.py and tests/test_snake.py from the base: create_snake, add_segment, extend, move, hits_wall, hits_tail, up, down, left, right, 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, so the tests pass fakes.

Phase: MIL-002

Copy `src/snake_game/snake.py` and `tests/test_snake.py` from the base: `create_snake`, `add_segment`, `extend`, `move`, `hits_wall`, `hits_tail`, `up`, `down`, `left`, `right`, 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, so the tests pass fakes. Phase: MIL-002
Tirsvad added this to the MIL-002: Adopt the game milestone 2026-10-08 11:05:15 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/021-snake-game#9