TuiTrivia is a trivia game for the terminal, allowing users to play trivia games, manage scores, and interact with a leaderboard. This project was made as part of a YSWS event by HackClub called TerminalCraft, the API and Database used in leaderboard management where created as part of this project and used knowledge I aquired from the RaspAPI YSWS event.
- Single-player and multiplayer modes
- Custom trivia questions
- Leaderboard management
- User authentication and registration
- API integration for leaderboard
- Python 3.10 or higher
requests
pwinput
termcolor
-
Clone the repository:
git clone https://github.com/yousseftechdev/TuiTrivia cd TuiTrivia
-
Install the required packages:
pip install -r requirements.txt
-
Run the trivia game:
python main.py
exit
: Exit the gamehelp
: Show help messageclear
: Clear the screenscores <local|global>
: Show high scoresclearscore <username>
: Clear your scoreclearall
: Clear all scorescleardb
: Clear the leaderboard database (ADMIN ONLY)editdb <old_username> <new_username> <new_score> <new_date>
: Edit a user entry in the leaderboard database (ADMIN ONLY)trivia
: Get a random trivia questioncustom
: Get a random custom trivia questionaddcustom
: Add a custom trivia questionmultiplayer
: Start a multiplayer gamedebug
: Show debug informationdebug color <color>
: Test colored outputdebug colors
: Show available colorsdevmode
: Enable/Disable developer modedifficulty <level>
: Set difficulty level (easy, medium, hard)category <name>
: Set question categorydebug api <url>
: Set API URL
- Flask: Used for the API
- Supabase: Used for storing leaderboard in a postgresql database
- Leapcell: Hosting the API and Database
This project is licensed under the MIT License.
- Open Trivia Database (https://opentdb.com/)
- Flask (https://flask.palletsprojects.com/)
- Supabase (https://supabase.com/)
- Leapcell (https://leapcell.io/)