Skip to content

Add Mind Break CLI number-guessing game in Python - #5

Merged
victornife merged 1 commit into
mainfrom
codex/create-cli-game-mind-break
May 21, 2026
Merged

victornife merged 1 commit into
mainfrom
codex/create-cli-game-mind-break

Conversation

@victornife

Copy link
Copy Markdown
Owner

Motivation

  • Provide a small interactive CLI game where a player-defined secret number (3–10 digits) is guessed with feedback on digit positions.
  • Support an optional max-attempts limit while allowing unlimited attempts by default.
  • Give clear, duplicate-aware feedback about digits in the correct position and digits present but misplaced.

Description

  • Added a new script mind_break_cli.py that implements the game loop and user prompts.
  • Implemented input validation for the secret number, max attempts, and each guess to ensure numeric-only input and correct lengths.
  • Implemented score_guess(secret, guess) to return (correct_position, wrong_position) and handle duplicate digits correctly.
  • The CLI reports attempts remaining (or unlimited), per-guess feedback, and ends when the player wins or exhausts attempts.

Testing

  • Ran a non-interactive smoke test using redirected stdin: python3 mind_break_cli.py <<'EOF' ... EOF, which exercised game start, scoring feedback, and the win condition, and the run completed as expected.
  • No automated unit tests were added in this change.

Codex Task

@victornife
victornife merged commit e0bc756 into main May 21, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant