A command-line word guessing game (hangman-style) built in Python. Choose a difficulty, guess letters one at a time, and try to reveal the full word before you run out of attempts.
- Three difficulty levels, each with its own word list and attempt budget
- Longer, harder words at higher difficulties
- Letter-by-letter guessing with a live masked view of the word
- Prevents re-guessing the same letter twice
- Validates that input is a single alphabetic character
- Reveals the word on a loss
- Replay loop, keep playing rounds without restarting the program
- Python 3.10+ (uses
matchstatement)
Run the game from the command line:
python main.pyYou'll be prompted to choose a difficulty, then guess letters one at a time:
Set game difficulty:
1. Easy
2. Medium
3. Advanced
1
Game difficulty set to Easy.
Enter a letter: a
_ _ _ _ _
Enter a letter: p
_ p p _ _
Enter a letter: l
_ p p l _
...
Bingo!
Wanna play again? (y/n):
| Option | Difficulty | Attempts | Word Length |
|---|---|---|---|
| 1 | Easy | 15 | ~5–8 letters |
| 2 | Medium | 10 | ~7–11 letters |
| 3 | Advanced | 5 | ~10–14 letters |
- Choose a difficulty; this selects both the word pool and how many wrong guesses you're allowed.
- A random word is picked from that difficulty's list.
- Guess one letter at a time:
- Correct letters are revealed in place in the masked word.
- Incorrect letters cost you an attempt.
- Already-guessed letters are rejected so you don't waste a turn.
- Guess every letter in the word before running out of attempts to win.
- If you run out of attempts, the full word is revealed.
- After each round (win or lose), choose whether to play again — a new random word is picked for each new round.
- Invalid difficulty: exits with a message if the input isn't a number or isn't one of the listed options.
- Invalid guess: re-prompts if the input isn't exactly one alphabetic character.
- Repeated guess: re-prompts without costing an attempt if the letter was already guessed.
.
├── main.py # Game logic and CLI
├── README.md
└── LICENSE
See LICENSE.