Skip to content

A C++ console Hangman game where players guess names of 195 countries. Features dynamic ASCII art that builds the gallows with every mistake, adding visual tension. Includes duplicate letter checks, automatic space handling for multi-word countries, and a 10-life system. A solid project for mastering C++ arrays and logic.

Notifications You must be signed in to change notification settings

Sikki-Codez/HangMan_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Country Hangman ๐ŸŒ

A feature-rich C++ console game where players test their geography knowledge by guessing the names of 195 countries. This project demonstrates the use of string manipulation, arrays, and game state management in C++.

๐Ÿ“ Description

This is a classic Hangman game tailored for geography enthusiasts. The program randomly selects a country from a comprehensive dataset of 195 nations. As the player guesses letters, the game provides visual feedback through dynamic ASCII art that builds the gallows with every mistake.

Key Logic:

  • Dynamic Drawing: Uses a state-mapping system to render the hangman figure based on the mistake count.
  • Input Validation: Prevents users from guessing the same letter twice.
  • Smart Formatting: Automatically reveals spaces for multi-word countries (e.g., "United Kingdom") to improve playability.

๐ŸŽฎ Features

  • Massive Dataset: Includes 195 countries (from Afghanistan to Zimbabwe).
  • Visual Progression: 11 distinct stages of ASCII art (from empty gallows to game over).
  • 10-Life System: Players are allowed 10 mistakes before the game ends.
  • Duplicate Protection: The game remembers guessed letters and warns the player without penalizing them.
  • Randomization: Uses srand(time(0)) to ensure a different country every time you play.

๐Ÿš€ How to Run

Prerequisites

You need a C++ compiler (like G++ or Clang) installed on your system.

Compilation

Open your terminal or command prompt and run:

g++ main.cpp -o hangman

About

A C++ console Hangman game where players guess names of 195 countries. Features dynamic ASCII art that builds the gallows with every mistake, adding visual tension. Includes duplicate letter checks, automatic space handling for multi-word countries, and a 10-life system. A solid project for mastering C++ arrays and logic.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages