Finish the README for the Day 21 repository
CI / checks (push) Successful in 44s
CI / checks (pull_request) Successful in 44s

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
This commit is contained in:
2026-10-08 18:45:54 +08:00
parent f2c5d610b5
commit f3f69feb56
+15 -4
View File
@@ -17,10 +17,10 @@ This repository continues
[020-snake-game](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/020-snake-game) [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. 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 > **Status:** the game is finished: the snake moves by itself, is steered with the
> game, adopted from the finished game of 020 together with its tests. The next > arrow keys, eats food and grows, the score is shown, and the game is over at the
> milestone, `MIL-003`, checks it against the day-21 lectures and finishes this > wall or at the tail. It was adopted from the finished game of 020 and checked
> README. > against the day-21 lectures; see `docs/project-plan.md`.
## Requirements ## Requirements
@@ -169,6 +169,17 @@ The HTML is written to `build/doxygen/index.html`. A warning fails the build.
└── README.md └── 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 ## License
GNU Affero General Public License v3.0 only. See [LICENSE](LICENSE). GNU Affero General Public License v3.0 only. See [LICENSE](LICENSE).