MirDima / python-project-49

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Brain Games: the collection of 5 math mini-games


Hexlet tests and linter status:

Actions Status Maintainability

This is project "Brain Games" on the Python Development course on Hexlet.io

Used technologies:

Dependencies:

  • python = "3.9^"
  • prompt = "0.4.1^"

Description:

"Mind Games" is a set of five console games based on the popular mobile brain-pumping apps. Each game asks questions that need to be answered correctly. After three correct answers, the game is considered completed. Incorrect answers end the game and prompt you to play it again.

Games:

  • Brain Even (Answer "yes" if the number is even, otherwise answer "no")
  • Brain Calculator (Answer what is the result of the expression?)
  • Brain GCD (Answer what is the greatest common divisor of given numbers)
  • Brain Progression (Answer what number is missing in the progression?)
  • Brain Prime (Answer "yes" if given number is prime, otherwise answer "no")

They are launched with simple commands:*

brain-even
brain-calc
brain-gcd
brain-progression
brain-prime

✏️*Make sure that you have Python version 3.6 or higher installed.

Demo:


Brain even πŸ•Ή

The idea of the game: the user is shown a random number. And he should answer yes if the number is even, or no if it is odd:

asciicast

Brain calculator πŸ•Ή

The user is shown a random mathematical expression, such as 35 + 16, which must be calculated and write down the correct answer.

asciicast

Brain GCD πŸ•Ή

The user is shown two random numbers, for example 25 and 50. The user must calculate and enter the greatest common divisor of these numbers.

asciicast

Brain progression πŸ•Ή

The user is shown a series of numbers with a missing number, forming an arithmetic progression. The player has to determine this number.

asciicast

Brain prime πŸ•Ή

The user is shown a random number. And he needs to answer yes if the number is prime, or no if it is composite:

asciicast


🌲Project file tree:

.
β”œβ”€β”€ brain_games
β”‚   β”œβ”€β”€ engine_game.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ logic.py
β”‚   β”œβ”€β”€ scripts
β”‚   β”‚   β”œβ”€β”€ brain_prime.py
β”‚   β”‚   β”œβ”€β”€ brain_even.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ brain_games.py
β”‚   β”‚   β”œβ”€β”€ brain_progression.py
β”‚   β”‚   β”œβ”€β”€ brain_calc.py
β”‚   β”‚   β”œβ”€β”€ cli.py
β”‚   β”‚   └── brain_gcd.py
β”‚   └── games
β”‚       β”œβ”€β”€ progression.py
β”‚       β”œβ”€β”€ prime.py
β”‚       β”œβ”€β”€ even.py
β”‚       β”œβ”€β”€ gcd.py
β”‚       └── calc.py
β”œβ”€β”€ Makefile
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ setup.cfg
└── poetry.lock

Good luck and have a fun game! 🀚

About


Languages

Language:Python 95.5%Language:Makefile 4.5%