A terminal-based Hangman game written in C++ that combines classic word guessing with programming-themed learning. Players can enjoy multiple game modes, use hints, track their score, and learn programming terms through built-in definitions.
- Single Player mode
- Multiplayer mode
- Custom Word mode
- Programming-themed word categories
- Hint system
- Score tracking
- ASCII Hangman animation
- Used and remaining letter tracking
- Randomized word selection
- Word definitions after each game
- Input validation
- Programming Concepts
- Data Types
- C++ Keywords
- C++11 or later
- Any C++ compiler
- g++
- MinGW
- MSVC
Using g++:
g++ main.cpp -o hangman./hangmanOn Windows:
hangman.exe.
├── main.cpp
├── README.md
└── CONTRIBUTING.md
- Launch the game.
- Choose a game mode.
- Select a category if playing Single Player.
- Guess one letter at a time.
- Use
!to reveal a letter using a hint. - Guess the complete word before running out of attempts.
A round of Single Player mode, Programming Concepts category:
==========================
HANGMAN
==========================
1. Single Player
2. Multiplayer
3. Add Custom Word
4. Exit
Choose Option: 1
Choose Category:
1. Programming
2. Data Types
3. Keywords
Choice: 1
+---+
| |
|
|
|
|
=========
Word: _ _ _ _ _ _ _ _
Attempts Left: 6
Score: 0
Hints Remaining: 2
Category Hint: Programming Concepts
Used Letters:
Remaining Letters: a b c d e f g h i j k l m n o p q r s t u v w x y z
Enter letter (! for hint): f
Correct!
+---+
| |
|
|
|
|
=========
Word: f _ _ _ _ _ _ _
Attempts Left: 6
Score: 10
Hints Remaining: 2
Category Hint: Programming Concepts
Used Letters: f
Remaining Letters: a b c d e g h i j k l m n o p q r s t u v w x y z
Enter letter (! for hint): u
Correct!
...
Word: f u n c t i _ n
Attempts Left: 6
Score: 60
Hints Remaining: 2
Category Hint: Programming Concepts
Used Letters: f u n c t i
Remaining Letters: a b d e g h j k l m o p q r s v w x y z
Enter letter (! for hint): o
Correct!
You Win!
Word: function
Word Definition:
Function: reusable block of code.
Play Again? (y/n): n
Thanks for playing!
If attempts run out before the word is completed, the full hangman is drawn and the game ends instead:
+---+
| |
O |
/|\ |
/ \ |
|
=========
Game Over!
The word was: function
Word Definition:
Function: reusable block of code.
Play Again? (y/n):
- Difficulty levels
- Save high scores
- Larger word database
- Colored terminal output
- Timed game mode
- File-based custom word storage
This project is available for educational and personal use.