Triv-IA is a command-line trivia game inspired by Trivial Pursuit, designed for multiple players. The game tests your knowledge in various categories related to IT, AI, and more, with a fun board and emoji avatars.
- Play with 1 to 6 players, each assigned a random emoji avatar.
- Move around a board with different categories and special "Camembert" (wedge) spaces.
- Answer multiple-choice questions from a JSON file, organized by category.
- Collect colored camemberts by answering correctly on special spaces.
- The first player to collect all camemberts wins!
- Bases de données (Databases)
- Python
- Actualités IA (AI News)
- Lignes de commandes: Unix (Unix Commands)
- Personnalités de l'IA (AI Personalities)
- DevOps
-
Start the Game
Run the main script:python main.py
-
Player Setup
- Enter the number of players (1-6).
- Each player enters their name and age.
- Each player is assigned a random emoji avatar.
-
Gameplay Loop
- Players take turns rolling a die and moving around the board.
- On each turn, the player lands on a category space and is asked a question.
- If the space is a Camembert, a correct answer earns a camembert of that color.
- The player who collects all 6 camemberts first wins.
test.py/main.py: Main entry point, runs the game loop.jeu.py: Contains the main game logic, player setup, turn management, and question handling.plateau.py: Manages the board, spaces, and their categories/types.case.py: Defines individual board spaces (category, position, type).joueur.py: Player class, tracks name, position, camemberts, and avatar.question.py: Question class, stores question text, choices, correct answer, and category.utils.py: Utility functions for console display, dice ASCII art, and color codes.questions_trivial_pursuit.json: JSON file with all questions, organized by category.
The board is visualized in the console with colored emojis representing categories and camemberts. Players' avatars are shown on their current position.
- Python 3.x
- No external dependencies (standard library only)
Edit questions_trivial_pursuit.json to add or modify questions. Each category contains a list of questions, each with:
question: The question textreponses: List of possible answersbonne_reponse_index: Index of the correct answer (starting from 0)categorie: (optional) The category name
Example:
{
"Python": [
{
"question": "Quel mot-clé permet de définir une fonction en Python ?",
"reponses": ["def", "function", "lambda", "fun"],
"bonne_reponse_index": 0
}
]
}- You can change the categories, emojis, and board size in
plateau.py. - Modify the player setup or add more features in
jeu.py.
- Michael Adebayo (@MichAdebayo)
- Hacene Zerrouk (@haceneZERROUK)
- Dorothée Catry (@DorotheeCatry)
