Skip to content

zluuba/brain-games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brain Games

Actions Status Project Status Maintainability Test Coverage

Brain Games includes five math games: 'Parity Check', 'Calculator', 'Greatest Common Divisor', 'Arithmetic Progression' and 'Prime Numbers'. All games are started and played using the terminal.

This is the first project on Python, so it's extremely simple.

Requirements

  • python, version 3.9 or higher
  • poetry, version 1.0.0 or higher

Installation

Clone this repo or download it with pip:

git clone https://github.com/zluuba/brain-games.git
pip install --user git+https://github.com/zluuba/brain-games.git

Install package and dependencies:

cd brain-games
make install
make build
make package-install

Commands

Type these commands to start the games:

# Parity Check game.
# Given a number, you must enter "yes" if the number is even and "no" if it's not.
brain-even


# Calculator game
# Given a mathematical expression, you need to calculate it and enter the result.
brain-calc


# The Greatest Common Divisor game
# Two numbers are given, you need find the greatest common divisor and enter the result.
brain-gcd


# Arithmetic Progression game
# Given an arithmetic sequence in which one number is hidden, you must enter the missing number.
brain-progression


# Prime Numbers game
# Given a number, you must enter "yes" if the number is prime and "no" if it's not
brain-prime

More about GSD and prime numbers.

Additional

If you have changed a few lines of code, use these commands to apply all the changes:

make build
make reinstall

To check the current project for compliance with the PEP8 standards, use this command:

make lint

The next command runs tests and checks the project for correctness:

make test

Demos

Even Game

asciicast

Calculator Game

asciicast

GreatestCommonDivisor Game

asciicast

Progression Game

asciicast

Prime Game

asciicast