A simple command-line Hangman game where players guess a randomly selected fruit name. The game provides a fun and interactive way to guess letters and reveal a hidden fruit word.
- Random fruit word selection
- Limited number of guessing chances
- Input validation
- Hints about the word category (fruits)
- Simple and intuitive gameplay
- Python 3.x
- No additional libraries required beyond standard Python libraries
- Run the script
- The game will randomly select a fruit name
- You'll see blank spaces representing the letters in the word
- Guess one letter at a time
- You have a limited number of chances equal to the word length plus 2
- Try to guess the entire word before running out of chances!
- Only single alphabetic letters are accepted
- Repeated letter guesses are not allowed
- Correct guesses reveal the letter in its correct position
- Incorrect guesses reduce your remaining chances
Guess the word! HINT: word is a name of a fruit
_ _ _ _ _
Enter a letter to guess: a
You have 6 chances left.
a _ a _ _
Enter a letter to guess: p
You have 5 chances left.
a p p _ _
Congratulations, You won!
- Add difficulty levels
- Implement a scoring system
- Create a larger word list
- Add ASCII art for visual feedback
python hangman.py- Press Ctrl+C to exit the game at any time
- apple
- banana
- mango
- strawberry
- orange
- grape
- pineapple
- apricot
- lemon
- coconut
- watermelon
- cherry
- papaya
- berry
- peach
- lychee
- muskmelon
Open-source. Feel free to fork and modify!
Suggestions and pull requests are welcome!