hazard-qna
v1.2.1
Published
Question-Answer based CLI game for JavaScript
Readme
ProLang Slayer 🧠🔥
ProLang Slayer is a powerful command-line quiz application designed to challenge and improve your knowledge of popular programming languages including JavaScript, Python, and C.
Engage in a vibrant terminal interface, test your coding wits, and survive a thrilling code-slaying experience — but beware: one wrong answer and it’s Game Over!
🚀 Features
- Language Selection: Choose between JavaScript, Python, or C.
- Randomized Questions: Shuffled using the Fisher-Yates algorithm for a unique experience every time.
- Interactive CLI: Built with
inquirer, styled usingchalk,chalk-animation, andgradient-string. - Scoring System: Earn a point for each correct answer.
- Sudden Death: A single incorrect answer ends the game.
- Victory Screen: Celebrate with styled ASCII art and final score display.
- Multiple Choice Format: Consistent and beginner-friendly.
- Cross-Language Support: 10 curated questions per language, covering basic to advanced concepts.
🛠 Prerequisites
- Node.js: Version 14 or higher
- npm: To install and manage dependencies
⚡ Installation
Run Instantly (Recommended)
Use npx to run without installing:
npx hazard-qnaLocal Installation (For Developers)
git clone <repository-url>
cd prolang-slayer
npm install chalk inquirer gradient-string chalk-animation figlet nanospinner console-clearOptional global installation:
npm install -g hazard-qna📁 Project Structure
prolang-slayer/
├── index.js # Main application logic
├── javascript.js # JavaScript question set
├── python.js # Python question set
├── C.js # C language question set🎮 Usage
You can run the app in three different ways:
1. Instantly via npx (most convenient):
npx hazard-qna2. Locally:
node index.js3. Globally (if installed with -g):
hazard-qna🧑💻 How to Play
- Launch the app.
- Select a programming language:
C,JavaScript, orPython. - Enter your name (optional).
- Answer each question correctly to proceed.
- One wrong answer = Game Over.
📸 Example Output
Welcome to ProLang Slayer
🔥 Code Quiz Challenge 🔥
Welcome! I'm a vibrant process ready to test your JavaScript or Python prowess. 💻
Choose your language and answer the question with precision — one error, and it's GAME OVER! 😎
Unleash your inner code ninja, let your dev spirit shine!
Ready for the epic start? Let’s dive in! 🚀
? Choose the language you want to slay >>> JavaScript
? What is your name? Alice
? JavaScript was created in 10 days then released on
✔ Checking answer... Wo-ooh!! Nice work Alice. That's a legit answer📦 Dependencies
chalk– For colorful terminal text.inquirer– Interactive prompts.gradient-string– Gradient terminal text.chalk-animation– Animated terminal messages.figlet– ASCII text generation.nanospinner– Loading animations.console-clear– Clears the terminal screen.
📝 Notes
- Built on Node.js’s non-blocking event loop.
- Covers both beginner and intermediate-level programming knowledge.
- Exits with:
- Code
0on success. - Code
1on game over.
- Code
- No score history is saved — fresh start every time.
🤝 Contributing
We welcome all contributions!
- Fork the repository.
- Create a feature branch.
- Add your changes (e.g., new questions, improvements).
- Submit a Pull Request with a clear description.
👨🎨 Credits
Crafted by 4lex.Riley.90s
Inspired by the passion for coding and interactive CLI experiences.
📄 License
This project is licensed under the MIT License.
