Skip to content

Add a "quick play" option that picks a random game #24

Description

@pushpam2404

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 GAMES still shifts the numbers correctly
  • python3 -m pytest passes

How to verify locally

python3 -m arcade     # use Surprise me a few times
python3 -m pytest

Difficulty

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

  1. johnjermiah-git commented on Oct 5, 2026

    @johnjermiah-git

    /claim

  2. github-actions commented on Oct 5, 2026

    @github-actions

    Assigned to @johnjermiah-git. It is yours.

    Next steps

    1. Fork this repo and clone your fork
    2. git checkout -b fix/short-description
    3. Make the change, commit, push
    4. Open a PR with Closes #24 in the description

    If you get stuck, comment here saying what you have tried. If you change your mind, comment /unclaim — no hard feelings, that is genuinely fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

difficulty: intermediateRequires reading existing codedomain: os-devxOpen Source & Developer ExperienceenhancementNew feature or requesthacktoberfestCounts toward Hacktoberfest 2026status: claimedAssigned to a contributor — do not start work on this

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions