This is a simple Hangman game implemented in Ruby. It allows players to guess letters to uncover a hidden word within a limited number of attempts.
- Ruby installed on your system
- Ensure you have Ruby installed. If not, download and install it from here.
- Clone this repository to your local machine.
git clone [email protected]:PeterG-ithub/cli-hangman.git
- Navigate to the directory where you cloned the repository.
cd cli-hangman
- Run
main.rb
to start the game.ruby .\lib\main.rb
- Open a terminal.
- Ensure you have Ruby installed by running
ruby --version
.ruby --version
If not, install Ruby using your package manager. ```bash sudo apt update sudo apt-get install ruby-full
- Clone this repository to your local machine.
git clone [email protected]:PeterG-ithub/cli-hangman.git
- Navigate to the directory where you cloned the repository.
cd cli-hangman
- Run
main.rb
to start the game.ruby lib/main.rb
This Hangman game is implemented in Ruby and runs in the command-line interface. Players can choose to start a new game or load a saved game. The game randomly selects a word from a predefined list, and the player attempts to guess the word letter by letter. If the player guesses a letter correctly, it is revealed in the word. Otherwise, the player loses a guess. The game ends when the player correctly guesses the word or runs out of guesses.
- Ruby
- JSON for serialization
- Start a new game or load a saved game
- Randomly select a word from a predefined list
- Allow the player to guess letters
- Display the word with placeholders for unrevealed letters
- Keep track of correct and incorrect guesses
- Save game progress to resume later
This Ruby Project is part of the curriculum provided by The Odin Project, an open-source online platform that offers free resources to learn web development.
- Website: The Odin Project
- Hangman Project: Hangman