BrainTrainer
🕹️

BrainTrainer

Created
May 14, 2024 03:37 AM
Tags
Python
Game Development
Public
Public
Description
Trivia game as part of 10.018 Computational Thinking for Design.
Slug
Published
December 10, 2022

Highlights

  • Developed a simple game using basic Python modules.

About the Project

We wanted to put our beginner Python knowledge into practice by creating a simple game. The game challenges players into a series of challenging geography and math questions.

How the Game Works

The game is a two-player turn-based game comprising of three mini-games, a log-in and sign-up system that keeps track of players’ progress and an ELO rating system that ranks players.
The code starts off by prompting the two players to log-in or sign-up, depending on whether they have existing user credentials or not. Each player is assigned three global lives. Once a player has zero lives remaining, the game will terminate.
Next, the first player is prompted to choose a mini-game, which both players will take turns to play. The player with the lower score will lose one global life. In the scenario where both players have the same score, no global lives will be deducted. Once the mini-game ends, the second player will be prompted to choose a mini-game to play again.
We have 3 mini-games to choose from (Geography Hangman, Higher or Lower, Quick Maths).

Games to Choose

Geography Hangman

In Geography Hangman, a question asking about the capital city of a country is prompted. The first player plays for three different words, followed by the second player. Each player gains points for a correct word. There will be an option to get a hint at the cost of some points.

Higher or Lower

In Higher or Lower, a question on which given city has a higher or lower population is prompted. A point is awarded if their given answer matches our calculations. These questions are consecutively launched until a player gets a question wrong.

Quick Maths

In Quick Maths, the first player must answer correctly a randomly generated math question as many times as possible. A point is awarded if the player gives the correct answer within the time limit. Each player is allowed three times to either get a question wrong or run out of time to answer. After which, the second player takes their turn to play.
The cumulative score from the mini-games played will be used to calculate the rankings of the players. The leaderboard displays the rankings of players based on the Elo rating system implemented.

Highlights

notion image
notion image
notion image

Datasets Used

The Basic World Cities Database from https://simplemaps.com/data/world-cities was used in this project.
It is licensed under the Creative Commons Attribution 4.0 license - https://simplemaps.com/data/license, https://creativecommons.org/licenses/by/4.0/. The dataset was processed to output a csv file containing only cities with that had a value for population and with a 'primary' value for the capital column of the dataset.