New high_score_file.py: read_high_score (with open, int; missing file created with 0; empty, non-numeric, negative or undecodable content reads as 0) and write_high_score (mode w).
Scoreboard(path=HIGH_SCORE_FILE): high_score is read at start; reset() writes the file only for a new high score.
Tests: conftest.py runs every test in a temporary folder; 149 -> 169 tests.
README: the high score file section.
Differences from the plan, for S01 to confirm
Task 5 says "a guard that fails a test that would open the default path". The guard is a chdir into a temporary folder for every test, so no test can reach a real data.txt; a test that used the default path is redirected, not failed. Every test of the file itself passes an explicit temporary path.
Checks run locally (fresh .venv)
pytest: 169 passed; ruff check and format --check: clean; mypy strict: clean; doxygen: 0 warnings
Real game from a temporary folder: first start created data.txt holding 0; with 7 in the file the game started and left it at 7.
Reaching a new high score and restarting in the real window is S01's check of Go/No-Go criterion 6; reading and writing are covered by the tests.
Delivers MIL-004 (RC-007, code review RC-012; autonomous mode, not independent).
Closes #23
Closes #24
Closes #25
Closes #26
Closes #27
Closes #28
Closes #29
## Changes from MIL-003
- `constants.py`: `HIGH_SCORE_FILE` (`data.txt`), `HIGH_SCORE_FILE_ENCODING`, `DEFAULT_HIGH_SCORE`.
- New `high_score_file.py`: `read_high_score` (with `open`, `int`; missing file created with 0; empty, non-numeric, negative or undecodable content reads as 0) and `write_high_score` (mode `w`).
- `Scoreboard(path=HIGH_SCORE_FILE)`: `high_score` is read at start; `reset()` writes the file only for a new high score.
- Tests: `conftest.py` runs every test in a temporary folder; 149 -> 169 tests.
- README: the high score file section.
## Differences from the plan, for S01 to confirm
Task 5 says "a guard that fails a test that would open the default path". The guard is a `chdir` into a temporary folder for every test, so no test can reach a real `data.txt`; a test that used the default path is redirected, not failed. Every test of the file itself passes an explicit temporary path.
## Checks run locally (fresh .venv)
- pytest: 169 passed; ruff check and format --check: clean; mypy strict: clean; doxygen: 0 warnings
- Real game from a temporary folder: first start created `data.txt` holding `0`; with `7` in the file the game started and left it at `7`.
Reaching a new high score and restarting in the real window is S01's check of Go/No-Go criterion 6; reading and writing are covered by the tests.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delivers MIL-004 (RC-007, code review RC-012; autonomous mode, not independent).
Closes #23
Closes #24
Closes #25
Closes #26
Closes #27
Closes #28
Closes #29
Changes from MIL-003
constants.py:HIGH_SCORE_FILE(data.txt),HIGH_SCORE_FILE_ENCODING,DEFAULT_HIGH_SCORE.high_score_file.py:read_high_score(withopen,int; missing file created with 0; empty, non-numeric, negative or undecodable content reads as 0) andwrite_high_score(modew).Scoreboard(path=HIGH_SCORE_FILE):high_scoreis read at start;reset()writes the file only for a new high score.conftest.pyruns every test in a temporary folder; 149 -> 169 tests.Differences from the plan, for S01 to confirm
Task 5 says "a guard that fails a test that would open the default path". The guard is a
chdirinto a temporary folder for every test, so no test can reach a realdata.txt; a test that used the default path is redirected, not failed. Every test of the file itself passes an explicit temporary path.Checks run locally (fresh .venv)
data.txtholding0; with7in the file the game started and left it at7.Reaching a new high score and restarting in the real window is S01's check of Go/No-Go criterion 6; reading and writing are covered by the tests.