Skip to content

wendylogan/hangman-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

hangman-simulator

A simple command-line word guessing game where players try to uncover a hidden word by guessing letters one at a time.

How to Run:

  1. Download or save the Python hangman.py file.
  2. Open your terminal or command prompt and use the cd command to navigate to the directory where you have downloaded the file. cd path/to/your/directory
  3. Execute the python script by running the following command. python hangman.py

How to Play:

  1. The game selects a random hidden word from a predefined list and shows the user the hidden word represented by underscores (e.g. "_ _ _ _ _" for a 5-letter word)
  2. Guess one letter at a time by typing it in the terminal
  3. Correct guesses will reveal the letter in its position(s)
  4. You're allowed 8 incorrect guesses before losing
  5. Win by guessing all letters before using up your 8 incorrect attempts

Game Features:

  • Random word selection using Python's random module
  • Visual display of guessed letters and remaining attempts
  • Case-insensitive input (both uppercase and lowercase letters accepted)
  • Input validation to ensure only single letters are entered

Game Rules:

  • Only one letter can be guessed at a time
  • Repeated guesses don't count against you
  • You win when all letters are revealed
  • You lose after 8 incorrect guesses

Example Gameplay:

Image 1: Game Start with 1 correct guess ("o") and 1 incorrect guess ("b")

Screenshot 2025-05-28 at 10 40 02 PM


Image 2: Game End (Win)

Screenshot 2025-05-28 at 10 41 18 PM


Image 3: Game End (Loss)

Screenshot 2025-05-28 at 10 38 55 PM