Skip to content

An interactive C++ console game where players guess numbers across 5 difficulty levels. Features random number generation, limited attempts, and replay functionality with a clean text-based interface.

License

Notifications You must be signed in to change notification settings

Amr4924/NumHunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 NumHunter - Number Guessing Game

C++ Windows License

An engaging console-based number guessing game with multiple difficulty levels

📋 Table of Contents

🎮 Overview

NumHunter is an interactive console-based number guessing game written in C++. The game challenges players to guess a randomly generated number within a limited number of attempts. With 5 different difficulty levels, players can choose their preferred challenge level, from beginner-friendly to expert mode.

✨ Features

  • 🎯 5 Difficulty Levels: From Very Easy to Very Hard
  • 🎲 Random Number Generation: Each game generates a unique number
  • 🔄 Replay Functionality: Play multiple rounds without restarting
  • 🎨 Clean Console Interface: User-friendly text-based UI
  • Fast & Lightweight: Minimal system requirements
  • 🔧 Cross-Platform: Works on Windows, Linux, and macOS

🎲 Game Rules

  1. Choose Your Difficulty: Select from 5 available difficulty levels
  2. Make Your Guess: Enter a number within the specified range
  3. Limited Attempts: You have a limited number of guesses based on difficulty
  4. Win or Lose: Successfully guess the number or run out of attempts
  5. Play Again: Choose to play another round or exit

🚀 Installation

Option 1: Download Pre-compiled Executable

  1. Download the latest release from the releases page
  2. Extract the files to your desired location
  3. Run NumHunter.exe

Option 2: Build from Source

See the Building from Source section below.

🎯 How to Play

  1. Launch the Game: Run the executable file
  2. Select Difficulty: Choose a number from 1-5 corresponding to your desired difficulty
  3. Read the Instructions: Each level shows the range and number of attempts
  4. Make Your Guesses: Enter numbers within the specified range
  5. Win or Learn: Either guess correctly or see the answer when attempts run out
  6. Continue Playing: Choose 'Y' to play again or 'N' to exit

📊 Difficulty Levels

Level Difficulty Range Attempts Description
1 Very Easy 1-5 4 Perfect for beginners
2 Easy 1-10 4 Great for casual players
3 Middle 1-15 3 Balanced challenge
4 Hard 1-30 3 For experienced players
5 Very Hard 1-50 2 Expert level challenge

🖼️ Screenshots

===============================
= **** Guess the number **** =
===============================

#LV(1) (Very Easy) Guidance "(4) Attempts Guess from (1) to (5)"
#LV(2) (Easy) Guidance "(4) Attempts Guess from (1) to (10)"
#LV(3) (Middle) Guidance "(3) Attempts Guess from (1) to (15)"
#LV(4) (Hard) Guidance "(3) Attempts Guess from (1) to (30)"
#LV(5) (Very Hard) Guidance "(2) Attempts Guess from (1) to (50)"

Please select the level
#1 (Very Easy)
#2 (Easy)
#3 (Middle)
#4 (Hard)
#5 (Very Hard)
: 3

Please guess the number from (1) to (15).
#1: 8
#2: 12
#3: 5
Congrats!5 = 5

🔨 Building from Source

Prerequisites

  • C++ Compiler: GCC, Clang, or MSVC
  • Build Tools: Make (optional)

Compilation Steps

Using G++

g++ -o NumHunter NumHunter.CPP

Using Visual Studio (Windows)

  1. Open Developer Command Prompt
  2. Navigate to project directory
  3. Run: cl NumHunter.CPP

Using Code::Blocks or Dev-C++

  1. Create a new project
  2. Add NumHunter.CPP to the project
  3. Build and run

Build Requirements

  • C++ Standard: C++11 or later
  • Libraries: Standard C++ library (iostream, vector, cstdlib, ctime)

🏗️ Project Structure

NumHunter/
├── NumHunter.CPP      # Main source code file
├── NumHunter.exe      # Compiled executable (Windows)
├── README.MD          # This file
└── .gitignore         # Git ignore rules (optional)

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the Repository
  2. Create a Feature Branch: git checkout -b feature/amazing-feature
  3. Commit Your Changes: git commit -m 'Add amazing feature'
  4. Push to Branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Ideas for Contributions

  • Add hint system (higher/lower feedback)
  • Implement score tracking
  • Add more difficulty levels
  • Create a GUI version
  • Add sound effects
  • Implement leaderboard system

🐛 Bug Reports

If you find a bug, please open an issue with:

  • Description of the bug
  • Steps to reproduce
  • Expected vs actual behavior
  • Your system information

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

[Your Name]

🙏 Acknowledgments

  • Thanks to the C++ community for excellent documentation
  • Inspired by classic number guessing games
  • Built with ❤️ for learning and fun

📊 Stats

GitHub repo size GitHub last commit GitHub issues


⭐ Star this repository if you found it helpful!

About

An interactive C++ console game where players guess numbers across 5 difficulty levels. Features random number generation, limited attempts, and replay functionality with a clean text-based interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages