Skip to content

A console-based math quiz game written in C++ that challenges players with randomly generated arithmetic questions of varying difficulty levels. The game supports addition, subtraction, multiplication, and division with interactive results, color-coded feedback, and a final score summary.

Notifications You must be signed in to change notification settings

AmrTamerDev/Math_Quiz_Game-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

๐ŸŽฏ Math Quiz Game in C++ ๐Ÿงฎ

An interactive console-based math quiz game built in C++ that challenges players with randomly generated arithmetic questions. Players can select difficulty levels and operation types, and the game provides real-time feedback with color-coded results. ๐ŸŽจโœ…โŒ

๐Ÿš€ Features

โœ… Play up to 100 questions per round
โœ… Choose from Easy, Medium, Hard, or Mixed difficulty levels
โœ… Supports Addition (+), Subtraction (-), Multiplication (*), and Division (/)
โœ… Randomized questions for a unique experience each time
โœ… Color-coded feedback:

  • ๐ŸŸฉ Green for correct answers
  • ๐ŸŸฅ Red + Sound for incorrect answers
  • ๐ŸŸจ Yellow for a draw
    โœ… Final score summary
    โœ… Option to play again

๐Ÿ“œ How to Play

1๏ธโƒฃ Run the program
2๏ธโƒฃ Choose the number of questions (1 to 100)
3๏ธโƒฃ Select a difficulty level:

  • 1 for Easy
  • 2 for Medium
  • 3 for Hard
  • 4 for Mixed
    4๏ธโƒฃ Pick an operation type:
  • 1 for Addition (+)
  • 2 for Subtraction (-)
  • 3 for Multiplication (*)
  • 4 for Division (/)
  • 5 for Mixed Operations
    5๏ธโƒฃ Answer the generated questions
    6๏ธโƒฃ View your final results
    7๏ธโƒฃ Play again or exit

๐Ÿ›  Code Overview

  • Random Number Generator: Generates random numbers based on the difficulty level
  • Game Logic: Uses an enum-based system to structure operations
  • User Input Handling: Ensures valid input for questions and difficulty
  • Structured Design: Organized using functions, structs, and enums
  • Console Formatting: Colors and formatting enhance user experience

๐Ÿ”ง Technologies Used

  • Language: C++
  • Concepts: Loops, Functions, Structs, Enums, Randomization
  • Libraries: <iostream>, <cstdlib>, <ctime>, <string>

๐ŸŽฏ Learning Outcomes

  • Practice C++ enums, structs, and functions
  • Understand random number generation
  • Improve user input validation and console formatting
  • Learn to implement interactive CLI-based games

๐Ÿ“œ License

This project is open-source. Feel free to fork, modify, and improve it! ๐ŸŽ‰

๐Ÿค Contributions

Contributions are welcome! If you have improvements, submit a Pull Request ๐Ÿš€


๐Ÿ“Œ Enjoy the challenge! Happy coding! ๐ŸŽฎ๐ŸŽฏ

About

A console-based math quiz game written in C++ that challenges players with randomly generated arithmetic questions of varying difficulty levels. The game supports addition, subtraction, multiplication, and division with interactive results, color-coded feedback, and a final score summary.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages