MIL-003 Console game: game loop, entry point and accepted use case #26

Merged
Tirsvad merged 3 commits from mil-003-game-loop into main 2026-10-04 17:50:34 +02:00
Owner

Summary

Delivers MIL-003 Console game: the game is now playable with python -m higher_lower.

  • game.py: show_round, ask_choice (re-asks on invalid input, any case) and play_game (score, B becomes A after a right guess, each account shown once per game, win message when the accounts run out)
  • __main__.py: main() plays a game; Ctrl+C and Ctrl+D leave with a goodbye
  • constants.py: goodbye message
  • Scripted tests for the loop, input handling, running out of accounts and main()
  • UCD-001, US-001, UC-001 and SSD-001 reviewed (RC-007 to RC-010, all Go) and Accepted; Traceability Matrix updated

Verification

pytest: 36 passed. doxygen Doxyfile: no warnings. No runtime dependencies added. .env is not referenced under src/ or tests/. Played a game from the console with piped input.

Notes

  • "Each account once per game" is stricter than UC-001 extension 5a (no account differs from A); it is what lets the data run out, and the use case stays consistent with it.
  • Author and reviewer are both S01 (single participant); noted in each review record.

Closes #12
Closes #13
Closes #14
Closes #15
Closes #16

## Summary Delivers MIL-003 Console game: the game is now playable with `python -m higher_lower`. - `game.py`: `show_round`, `ask_choice` (re-asks on invalid input, any case) and `play_game` (score, B becomes A after a right guess, each account shown once per game, win message when the accounts run out) - `__main__.py`: `main()` plays a game; Ctrl+C and Ctrl+D leave with a goodbye - `constants.py`: goodbye message - Scripted tests for the loop, input handling, running out of accounts and `main()` - UCD-001, US-001, UC-001 and SSD-001 reviewed (RC-007 to RC-010, all Go) and Accepted; Traceability Matrix updated ## Verification `pytest`: 36 passed. `doxygen Doxyfile`: no warnings. No runtime dependencies added. `.env` is not referenced under `src/` or `tests/`. Played a game from the console with piped input. ## Notes - "Each account once per game" is stricter than UC-001 extension 5a (no account differs from A); it is what lets the data run out, and the use case stays consistent with it. - Author and reviewer are both S01 (single participant); noted in each review record. Closes #12 Closes #13 Closes #14 Closes #15 Closes #16
Tirsvad added 3 commits 2026-10-04 17:50:00 +02:00
Review the use case chain for Play a Game (RC-007 to RC-010, all Go)
and accept the four documents. Update the Traceability Matrix.
Add show_round, ask_choice and play_game with injectable input and
output, and make python -m higher_lower play a game. Each account is
shown once per game; a wrong guess or running out of accounts ends it.
Invalid input is re-asked. Ctrl+C and Ctrl+D leave with a goodbye.
Cover the loop with scripted tests (36 passing).

Task: MIL-003#1
Task: MIL-003#2
Task: MIL-003#3
Task: MIL-003#4
Task: MIL-003#5
Closes #12
Closes #13
Closes #14
Closes #15
Closes #16
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tirsvad merged commit cbdcba0a9f into main 2026-10-04 17:50:34 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100_days_of_code/014-higher_lower#26