Repository navigation
Description
Context
Sometimes you just want to play something. A "surprise me" option is a small
feature that shows off the registry pattern nicely.
What to change
File: arcade/main.py
Add a menu option that picks a random game from GAMES and plays it.
The menu numbering is currently computed from len(GAMES) in three places
(quit_option, scores_option, and the printing in show_menu()). Adding a
fourth option by hand will make that worse. Restructure it so the extra
options are defined once, not recomputed in each function. That refactor is
the real content of this issue.
Acceptance criteria
- A "Surprise me" option plays a random game
- It announces which game was chosen before starting
- The score is saved against the correct game name
- Menu option numbers are defined in one place, not recomputed
- Adding a game to
GAMESstill shifts the numbers correctly -
python3 -m pytestpasses
How to verify locally
python3 -m arcade # use Surprise me a few times
python3 -m pytestDifficulty
Intermediate. The feature is easy; the tidy-up is the point.
New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.
Stuck at any point? Comment here saying what you have tried, or come to a PR Debug Clinic (Oct 12 or Oct 21). Getting stuck is the normal experience of learning this, not a sign you are doing it wrong.
Activity
johnjermiah-git commentedon Oct 5, 2026
/claim
github-actions commentedon Oct 5, 2026
Assigned to @johnjermiah-git. It is yours.
Next steps
git checkout -b fix/short-descriptionCloses #24in the descriptionIf you get stuck, comment here saying what you have tried. If you change your mind, comment
/unclaim— no hard feelings, that is genuinely fine.