Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leo10manyam/hangman
Hangman is a classic word-guessing game that challenges players to guess a hidden word by suggesting letters within a limited number of attempts. This Python version of Hangman brings the traditional pen-and-paper game to your terminal, with simple, interactive gameplay. The game randomly selects a word from a predefined list.
https://github.com/leo10manyam/hangman
python python3
Last synced: about 1 month ago
JSON representation
Hangman is a classic word-guessing game that challenges players to guess a hidden word by suggesting letters within a limited number of attempts. This Python version of Hangman brings the traditional pen-and-paper game to your terminal, with simple, interactive gameplay. The game randomly selects a word from a predefined list.
- Host: GitHub
- URL: https://github.com/leo10manyam/hangman
- Owner: leo10manyam
- Created: 2024-10-06T16:00:43.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-11-09T08:20:36.000Z (3 months ago)
- Last Synced: 2024-11-09T09:23:22.742Z (3 months ago)
- Topics: python, python3
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
How to Play Hangman
Objective
The goal of Hangman is to guess a hidden word, one letter at a time, before you run out of attempts. Each incorrect guess reduces your remaining chances, so think carefully before each guess!Steps to Play
Start the GameWhen the game begins, a word is chosen at random and represented by underscores (_) for each letter. For example, if the word is "PYTHON," it will display as:
_ _ _ _ _ _
Make a GuessEnter a letter that you think might be in the word.
If the letter is correct, it will be revealed in its correct positions in the word.
If the letter is incorrect, you lose one attempt.
Repeat GuessesKeep guessing letters one at a time.
If you repeat a letter you've already guessed, the game will prompt you to try a different letter.
The game will show you the current progress of the word and how many attempts you have left.
Winning the GameIf you guess all the letters correctly before running out of attempts, you win! The game will display a message like:
arduinoCongratulations! You guessed the word: PYTHON
Losing the GameIf you run out of attempts without guessing the word, you lose. The game will reveal the correct word and display a message like:
vbnetSorry, you've run out of attempts! The word was: PYTHON
Example Gameplay
Start:
yamlWord: _ _ _ _ _
Attempts left: 6
First Guess:
Guess: A
If A is in the word, it will appear in the correct positions.
If A is not in the word, your attempts decrease by 1.
Ongoing Game Status:
yamlWord: _ A _ _ _
Attempts left: 5
Final Outcome:
If you guess all letters before attempts run out:
arduinoCongratulations! You guessed the word: APPLE
If you run out of attempts:
vbnetSorry, you've run out of attempts! The word was: APPLE
Tips
Start by guessing common vowels (like A, E) and frequently used consonants (like T, N).
Avoid repeating letters to save your attempts.
Use clues from correctly guessed letters to figure out possible words.
Enjoy playing Hangman and try to improve your guessing strategy each time!