/Brain-Games

Primary LanguageJavaScript

Brain Games

Maintainability Node CI

Description

A set of 5 mini cli games: 'Is Even', 'Calculator', 'Greatest Common Divisor', 'Arithmetic Sequence', 'Is Prime'.

Running either game will:

  • prompt a player to enter his/her name;
  • greet the player;
  • explain task;
  • ask 3 random questions according to the task;
  • congratulate player upon all correct answers.

If the answer is wrong at any point:

  • a notification will show that the given answer is wrong along with the correct answer;
  • the game will terminate.

Installation

$ git clone https://github.com/nstme/frontend-project-lvl1.git
$ cd frontend-project-lvl1
$ sudo npm link

asciicast

'Is Even' Game

Player has to answer if a given random integer is even.

$ brain-even

asciicast

'Calculator' Game

Player has to calculate a result of a random math expression -- adding or substraction or multiplication of 2 random integers.

$ brain-calc

asciicast

'Greatest Common Divisor' Game

Player has to find a greatest common divisor of 2 random integers.

$ brain-gcd

asciicast

'Arithmetic Sequence' Game

Player has to provide a missing integer in the random arithmetic sequence.

$ brain-progression

asciicast

'Is Prime' Game

Player has to answer if a given random integer is prime.

$ brain-prime

asciicast