Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 Game

When 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 Guess

Enter 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 Guesses

Keep 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 Game

If you guess all the letters correctly before running out of attempts, you win! The game will display a message like:
arduino

Congratulations! You guessed the word: PYTHON
Losing the Game

If you run out of attempts without guessing the word, you lose. The game will reveal the correct word and display a message like:
vbnet

Sorry, you've run out of attempts! The word was: PYTHON
Example Gameplay
Start:
yaml

Word: _ _ _ _ _
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:
yaml

Word: _ A _ _ _
Attempts left: 5
Final Outcome:
If you guess all letters before attempts run out:
arduino

Congratulations! You guessed the word: APPLE
If you run out of attempts:
vbnet

Sorry, 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!