A Ruby implementation of the classic Hangman game, created as part of The Odin Project.
Hangman is a word-guessing game where the player attempts to guess a hidden word within a limited number of attempts.
- Configurable Attempts: Adjust the number of attempts by modifying the
ATTEMPTS
constant. - Save and Load: Save your game progress and load it later.
- Dynamic Word Selection: Randomly selects a word from a dictionary file (
dictionary.txt
).
- Ensure Ruby is installed on your system.
- Clone the repository:
git clone https://github.com/your-username/hangman-game.git
- Navigate to the project directory:
cd odin-hangman
- Run the game:
ruby play.rb
- Start the Game: Run the command above.
- If a saved game is detected, you'll be prompted to load it.
- Gameplay:
- Guess letters to reveal the hidden word.
- Input letters or type 'save' to save your progress.
- Feedback: The game displays the current state, wrong guesses, and attempts left.
- Game End: The game ends when you guess the word or run out of attempts.