C++ Quiz Engine
A fun, terminal-based multiple-choice quiz game with leaderboards and question editor — built in pure C++
C++ Platform License
Features
- 100% offline — no internet required
- Thousands of questions supported (easy/medium/hard + categories)
- Random question & answer shuffling
- Timer for each quiz session
- Persistent high-score leaderboard with timestamps
- Built-in question editor (add new questions without editing files)
- Clean, colorful terminal interface - Fully cross-platform (Windows, macOS, Linux)
Files in this Repository
quiz.cpp ← Main source code (single file!)
questions.txt ← Database of all questions (pipe-separated)
scores.txt ← Leaderboard (auto-created on first run)
README.md ← This file
How to Run (VS Code + CodeRunner – Recommended)
1. Install CodeRunner extension in VS Code
2. Open quiz.cpp
3. Press Ctrl + Alt + N (or click the Play button)
4. Enjoy!
Make sure your CodeRunner C++ command includes
-std=c++17
(already guided in the previous message)
### Manual Compile & Run (Terminal) ```bash g++ -std=c++17 -O2 quiz.cpp -o quiz ./quiz # Linux / macOS
quiz.exe # Windows
### Sample Question Format (questions.txt)
```txt
easy|C++ Basics|What is the output of cout << "Hello";?|World|Hello|Error|None|B
medium|OOP|Which keyword is used to inherit a class?|extends|inherits|using|:|D
hard|STL|Which container has O(1) average lookup?|vector|list|unordered_map|set|C
Contributing Feel free to:
- Add more questions (just follow the format above)
- Improve the UI or add new features
- Open issues or PRs — all contributions welcome!
License MIT © 2025 – Free to use, modify, and distribute.
Have fun quizzing and happy coding!