This is a simple Hangman game implemented in C. The player tries to guess a secret word by suggesting letters. If the player guesses all the letters before running out of tries, they win!
-
Clone the repository:
git clone https://github.com/aboualine/Hangman-Game.git cd hangman -
Compile the code:
gcc hangman.c -o hangman
-
Run the game:
./hangman
- The game will display the secret word with underscores representing the unknown letters.
- You have a limited number of tries (6).
- Enter a letter and press Enter.
- If the letter is in the secret word, it will be revealed.
- If the letter is not in the word, you lose a try.
- If you guess all the letters correctly, you win!
- If you run out of tries, you lose.
- Random word selection from a list.
- Case-insensitive input (you can enter uppercase or lowercase letters).
- Checks for duplicate guesses (you won't be penalized for guessing the same letter twice).
- Clear prompts and output messages.
Contributions are welcome! Feel free to submit pull requests for bug fixes, new features, or improvements.
The current word list is defined within the hangman.c file. You can modify it to add or remove words.
- Implement different difficulty levels.
- Add a scoring system.
- Improve the user interface (consider using a library like ncurses for a more interactive experience).
- Allow the user to choose the word category.