im-a-teapot
v1.1.2
Published
A terminal-based quiz game built with Node.js. Test your knowledge in HTTP status codes, PHP, Laravel, Node.js, C#, SQLite, HTML/CSS, and JavaScript!
Downloads
531
Readme
☕ I'm a Teapot
A terminal-based quiz game built with Node.js. Test your knowledge in HTTP status codes, PHP, Laravel, Node.js, C#, SQLite, HTML/CSS, and JavaScript!
The name is a reference to HTTP status code 418 "I'm a teapot" – an Easter egg in the HTTP protocol.
🎮 Features
- 8 subject areas: HTTP Status Codes, PHP, Laravel, Node.js, C#, SQLite, HTML/CSS, and JavaScript
- Randomized questions: 5 questions per round from a pool of 20 per subject
- Highscore system: Top 10 scores saved permanently with subject tracking
- Interactive menus: Navigate easily with arrow keys
- ASCII-art: Beautiful titles in the terminal
- Instant feedback: See if your answer was correct after each question
📦 Installation
Option 1: Run directly with npx (no installation required)
npx im-a-teapotOption 2: Install from npm
npm install i im-a-teapot
# Then run from anywhere
im-a-teapotOption 3: Clone from GitHub
# Clone the project
git clone https://github.com/EddieJohanssonn3000/Im-a-teapot.git
# Navigate to the folder
cd Im-a-teapot
# Install dependencies
npm install
# Start the game
npm start🚀 Usage
# Run with npx (easiest)
npx im-a-teapot
# Or if installed globally
im-a-teapot
# Or run directly with node (if cloned)
node index.js🎯 How to Play
- Select PLAY from the main menu
- Choose a subject (Status Codes / PHP / Laravel / Node / C# / SQLite / HTML-CSS / JavaScript)
- Answer 5 randomly selected questions by choosing the correct option
- View your score and enter your name for the highscore
- Choose to play again or return to the menu
📁 Project Structure
Im-a-teapot/
├── index.js # Main file - starts the app and handles navigation
├── game/
│ ├── game.js # Game logic and question handling
│ └── highscore.js # Read/write/display highscore
├── questions/
│ ├── status.json # 20 questions about HTTP status codes
│ ├── php.json # 20 questions about PHP
│ ├── laravel.json # 20 questions about Laravel
│ ├── node.json # 20 questions about Node.js
│ ├── csharp.json # 20 questions about C#
│ ├── sqlite.json # 20 questions about SQLite
│ ├── html-css.json # 20 questions about HTML & CSS
│ └── javascript.json # 20 questions about JavaScript
├── utils/
│ └── ui.js # Menus and UI components
├── data/
│ └── highscore.json # Saved highscore data (top 10)
└── package.json🛠️ Technologies
| Package | Usage | |---------|-------| | inquirer | Interactive questions in the game | | @inquirer/prompts | Modern prompt components for menus | | figlet | ASCII-art for titles | | chalk | Colors in the terminal | | cli-table3 | Formatted tables for highscore |
📸 Screenshot
___ _ _____ _
|_ _( )_ __ ___ __ _ |_ _|__ __ _ _ __ ___ | |_
| ||/| '_ ` _ \ / _` | | |/ _ \/ _` | '_ \ / _ \| __|
| | | | | | | | | (_| | | | __/ (_| | |_) | (_) | |_
|___| |_| |_| |_| \__,_| |_|\___|\__,_| .__/ \___/ \__|
|_|
? Choose an option:
❯ PLAY
HIGHSCORE
EXIT📚 Available Subjects
| Subject | Questions | Description | |---------|-----------|-------------| | HTTP Status Codes | 20 | Test your knowledge of HTTP response codes | | PHP | 20 | Variables, functions, arrays, and more | | Laravel | 20 | Artisan commands, Blade, Eloquent, and routing | | Node.js | 20 | npm, modules, Express, and async/await | | C# | 20 | Classes, methods, LINQ, and OOP concepts | | SQLite | 20 | SQL queries, joins, and database operations | | HTML & CSS | 20 | Tags, selectors, flexbox, and styling | | JavaScript | 20 | DOM, functions, arrays, and ES6 features |
🏆 Highscore System
- Top 10 scores are saved permanently in
data/highscore.json - Scores are sorted from highest to lowest
- Each entry includes player name, score, and subject
- Get notified if you make it to the top 10! 🥳
📄 License
MIT License - see LICENSE for details.
