From f3f69feb568efdd3354f6e9ac8cac2710ac50674 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Thu, 8 Oct 2026 18:45:54 +0800 Subject: [PATCH] Finish the README for the Day 21 repository The Status block now says the game is finished and checked against the day-21 lectures, and a table shows where each lesson lives in the code (inheritance, collisions with the food, the scoreboard, the wall, the tail and slicing). No source file changes: the comparison with the lectures found no difference. Task: MIL-003#7 Closes #21 --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2187053..398d78b 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ This repository continues [020-snake-game](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/020-snake-game) and starts from its finished game; `docs/project-plan.md` tells how the work is split. -> **Status:** the game is in the repository: `python -m snake_game` plays the whole -> game, adopted from the finished game of 020 together with its tests. The next -> milestone, `MIL-003`, checks it against the day-21 lectures and finishes this -> README. +> **Status:** the game is finished: the snake moves by itself, is steered with the +> arrow keys, eats food and grows, the score is shown, and the game is over at the +> wall or at the tail. It was adopted from the finished game of 020 and checked +> against the day-21 lectures; see `docs/project-plan.md`. ## Requirements @@ -169,6 +169,17 @@ The HTML is written to `build/doxygen/index.html`. A warning fails the build. └── README.md ``` +Where the day-21 lessons are in the code, so that you can compare it with your own +solution: + +| Day-21 lecture | Where it is | +| --- | --- | +| Class inheritance | `Food(Turtle)` in `food.py` and `Scoreboard(Turtle)` in `scoreboard.py` | +| Collisions with the food | `Food.refresh`, `eat_food_if_close` in `main.py`, `FOOD_*` in `constants.py` | +| The scoreboard | `Scoreboard.update_scoreboard` and `Scoreboard.increase_score` | +| The wall | `Snake.hits_wall`, `WALL_LIMIT`, and `Scoreboard.game_over` for the text | +| The tail and slicing | `Snake.extend`, `Snake.add_segment` and `Snake.hits_tail`, which loops over `segments[1:]` | + ## License GNU Affero General Public License v3.0 only. See [LICENSE](LICENSE).