mitre

Create a Basic Trivia Game

The Basic Trivia Game allows players to answer multiple-choice questions, providing immediate feedback on their answers. Players select answers from a set of trivia questions and receive feedback indicating whether their choice was correct or incorrect. At the end of the game, players are given a final score based on the number of correct answers. Use any language to complete the features and stories.

(F) Minimum Viable Product (MVP)
link

Display trivia questions with multiple-choice answers, provide immediate feedback, show a final score, and begin with a welcome message and instructions.

optional
circle
(S) Game Initialization

As a player I want the game to start with a welcome message and instructions, so that I know how to play the game and what to expect.

Key Points
  • The game should display a welcome message at the start.
  • Basic instructions on how to play and input answers should be provided.
  • The game should start immediately after displaying the instructions.
optional
circle
(S) Question Display

As a player, I want to see a trivia question with multiple-choice answers, so that I can select the correct answer

Key Points
  • Each question should be displayed with a clear prompt.
  • There should be four multiple-choice options labeled A, B, C, and D.
  • The player should be able to input their choice using the corresponding letter.
optional
circle
(S) Question Display

As a player, I want to see a trivia question with multiple-choice answers, so that I can select the correct answer

Key Points
  • Each question should be displayed with a clear prompt.
  • There should be four multiple-choice options labeled A, B, C, and D.
  • The player should be able to input their choice using the corresponding letter.
optional
circle
(S) Answer Evaluation

As a player, I want to receive immediate feedback on my answer, so that I know if I was correct and can learn from my mistakes.

Key Points
  • The game should inform the player if their answer was correct or incorrect immediately after they answer.
  • If incorrect, the game should display the correct answer.
  • The game should track the number of correct answers.
optional
circle
(S) Score Display

As a player, I want to see my final score at the end of the game, so that I can assess my performance.

Key Points
  • The final score should be displayed after the last question.
  • The score should show the number of correct answers out of the total questions.
  • The game should display a closing message summarizing the player’s performance.
(F) Score Tracking Feature
link

Track player's score throughout the trivia game, updating for correct answers and saving results to a JSON file for later retrieval and review.

optional
circle
Learn JSON

JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans and machines to read and write. Learn about it if needed.

Key Points
  • You'll need to learn how to read and write JSON to and from a file for this feature.
optional
circle
(S) Ask Player for Name

As a player, I want the game to ask for my name at the start, so that I can personalize my game experience and have my scores associated with my name.

Key Points
  • At the start of the game, the player should be prompted to enter their name.
  • The game should store the player's name for use in score tracking and display.
  • The game should greet the player using their name.
optional
circle
(S) Real-Time Score Tracking

As a player, I want the game to keep track of my score during the trivia round, so that I can see how well I am performing as I play.

Key Points
  • The game should start with a score of zero for each player.
  • The score should increment by one for each correct answer.
  • The current score should be available for display at any point during the game.
optional
circle
(S) Save Score to JSON

As a player, I want the game to save my score to a JSON file, so that my achievements are recorded and I can track my progress over time.

Key Points
  • At the end of the game, the player's name and score should be saved to a JSON file.
  • The JSON file should store scores for multiple players, appending new scores without overwriting existing data.
  • The file should be structured in a way that is easy to read and understand.
optional
circle
(S) Load Scores from JSON

As a player, I want the game to load and display previous scores from a JSON file, so that I can view my past performances and compare them with my current scores.

Key Points
  • Upon starting the game, the program should load scores from the existing JSON file.
  • The game should display a list of previous scores, including player names and their corresponding scores.
  • The display should be clear and sorted, allowing players to easily identify their past achievements.
(F) Support for Multiple Trivia Decks
link

Load trivia decks from a directory, display a menu of decks for selection, show deck metadata, and run the game with the chosen deck.

Tip: Think about how you should store and read the decks based on the previous feature.

optional
circle
(S) Deck Directory Reading

As a developer, I want the program to read trivia decks from a directory, so that the game can dynamically load and use different sets of questions without hardcoding them.

Key Points
  • The program should be able to read all files within a specified directory containing trivia decks.
  • Each deck should be formatted correctly and include a category and questions.
  • The program should validate the content of each file to ensure it is usable.
optional
circle
(S) Deck Selection Menu

As a player, I want to see a menu of available trivia decks, so that I can choose which set of questions I want to play with.

Key Points
  • The game should display a list of available decks, each with a category and the number of questions.
  • The player should be able to select a deck using a simple input mechanism (e.g., entering a number or letter).
  • The game should confirm the player's selection before starting the trivia round.
optional
circle
(S) Deck Metadata Display

As a player, I want to see the category and number of questions for each deck, so that I can make an informed decision about which deck to play.

Key Points
  • Each deck in the menu should display its category.
  • The number of questions in each deck should be shown alongside its category.
  • Deck information should be clearly formatted for easy reading.
optional
circle
(S) Running the Game with Selected Deck

As a player, I want the game to run with the deck I selected, so that I can play a round of trivia with my chosen set of questions.

Key Points
  • Once a deck is selected, the game should load and present questions from that deck.
  • The game should proceed as per the existing rules, using the selected deck for questions.
  • At the end of the game, the player's score should be based solely on the selected deck's questions.