npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

brain-games-afanasev7

v1.9.1

Published

my first js project

Downloads

5

Readme

Brain Games

BrainGames is a set of mini-games launched from the console.

Setup

$ make install

List of games

  1. Brain-calc
  2. Brain-even
  3. Brain-gcd
  4. Brain-prime
  5. Brain-progression

The game scenario is structured as follows:

The user is shown a description of the game. The next question is asked. In the case of three correct answers in a row, the game ends with a congratulation. Otherwise, the game fails.

Brain-calc

The essence of the game is as follows: the user is shown a random mathematical expression, for example 35 + 16, which needs to be calculated and written down the correct answer:

$ brain-calc

Welcome to the Brain Games!
What is the result of the expression?

May I have your name? Sam
Hello, Sam!

Question: 4 + 10
Your answer: 14
Correct!
Question: 25 - 11
Your answer: 14
Correct!
Question: 25 * 7
Your answer: 175
Correct!
Congratulations, Sam!

An example of a game with the wrong answer:

Question: 25 * 7
Your answer: 145
'145' is wrong answer ;(. Correct answer was '175'.
Let's try again, Sam!

Brain-even

The essence of the game is as follows: a random number is shown to the user. And he needs to answer yes if the number is even, or no if it is odd:

$ brain-even

Welcome to the Brain Games!
Answer "yes" if the number is even, otherwise answer "no".

May I have your name? Sam
Hello, Sam!

Question: 15
Your answer: no
Correct!
Question: 6
Your answer: yes
Correct!
Question: 7
Your answer: no
Correct!
Congratulations, Sam!

An example of a game with the wrong answer:

Question: 15
Your answer: no
'yes' is wrong answer ;(. Correct answer was 'no'.
Let's try again, Sam!

Brain-gcd

The essence of the game is as follows: two random numbers are shown to the user, for example, 25 50. The user must calculate and enter the largest common divisor of these numbers. The conclusion should be the following:

$ brain-gcd

Welcome to the Brain Games!
Find the greatest common divisor of given numbers.

May I have your name? Sam
Hello, Sam!

Question: 25 50
Your answer: 25
Correct!
Question: 100 52
Your answer: 4
Correct!
Question: 3 9
Your answer: 3
Correct!
Congratulations, Sam!

An example of a game with the wrong answer:

Question: 25 50
Your answer: 25
'50' is wrong answer ;(. Correct answer was '25'.
Let's try again, Sam!

Brain-progression

The essence of the game is as follows: the player is shown a series of numbers forming an arithmetic progression, where any of the numbers is replaced by two points. The player must determine this number.

$ brain-progression

Welcome to the Brain Game!
What number is missing in this progression?

May I have your name? Roman
Hello, Roman!

Question: 14 .. 18 20 22 24 26 28
Your answer: 16
Correct!
Question: 5 6 7 8 9 .. 11 12
Your answer: 10
Correct!
Question: 12 15 18 21 .. 27 30 33
Your answer: 24
Correct!
Congratulations, Roman!

An example of a game with the wrong answer:

Question: 14 .. 18 20 22 24 26 28
Your answer: 15
'15' is wrong answer ;(. Correct answer was '16'.
Let's try again, Roman!

Brain-prime

The essence of the game is as follows: user is shown a random number. And he needs to answer yes if the number is prime, or no if it is not simple:

$ brain-prime

Welcome to the Brain Game!
Answer "yes" if given number is prime. Otherwise answer "no".

May I have your name? Roman
Hello, Roman!

Question: 13
Your answer: yes
Correct!
Question: 97
Your answer: yes
Correct!
Question: 24
Your answer: no
Correct!
Congratulations, Roman!

An example of a game with the wrong answer:

Question: 100
Your answer: yes
'yes' is wrong answer ;(. Correct answer was 'no'.
Let's try again, Roman!