Skip to content

A cli project of five brain games with advanced features

Notifications You must be signed in to change notification settings

rostex/brain-games-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Brain Games

This project is a set of five console games:

  • Even game – Definition of an even number
  • Calc game – Arithmetic expressions
  • GCD game – Finding the Greatest Common Divisor
  • Progression game – Search for missing number in a sequence of numbers
  • Prime game – Definition of a prime number

Game Features:

  • Levels of Difficulty – Choose from three difficulty levels: Easy (default), Medium, and Hard. The difficulty affects the complexity of the questions.
  • Scoring System – Earn points for correct answers. If you provide an incorrect answer, points will be subtracted. After blocks of answers, the game is considered completed.
  • Statistics – View the statistics of the top players (best local total score).
  • Settings – You can change the player’s name and select the difficulty level through the Settings menu. The default difficulty is Easy.

Each game asks a series of questions that need to be answered correctly. After three correct answers, the game is considered completed. Wrong answers will end the game and reduce the total score.

Links to Other Sections:

How to Run the Game

To play Brain Games, follow these steps:

  1. Download the JAR File

    First, you need to download the compiled .jar file. You can find it in the Releases section of the GitHub repository.

  2. Install Java

    Ensure that you have Java 21 or later installed on your system. You can check if Java is installed by running the following command in your terminal or command prompt:

java -version

If Java is not installed, download and install the latest version from the official Java website.

  1. Run the JAR File

    Once you have the .jar file and Java installed, navigate to the directory where the .jar file is located. Open your terminal or command prompt and run the following command:

java -jar brain-games-cli.jar

This will start the game and you can follow the instructions on the screen to play the games.

  1. Enjoy the Game!

    Follow the on-screen prompts to choose a game, set your difficulty level, and start playing!

Saving Player Data

Where the Data is Stored

The game saves player statistics (score data) in a file located in the following directories depending on the operating system:

  • Windows:

    • The data is saved in the APPDATA directory, under Brain Games CLI.
    • Typical path: C:\Users\<YourUsername>\AppData\Roaming\Brain Games CLI\PlayersStat.yml
  • macOS:

    • The data is saved in the user's Library/Application Support directory.
    • Typical path: /Users/<YourUsername>/Library/Application Support/Brain Games CLI/PlayersStat.yml
  • Linux:

    • The data is saved in the home directory.
    • Typical path: /home/<YourUsername>/.Brain Games CLI/PlayersStat.yml

If the directory doesn't exist, the game will create it automatically when saving the player’s statistics.

What Data is Stored

The statistics include the player’s name and their total score from completed games. The game stores the top players' scores, and these can be viewed in the Statistics menu.

How to Change Settings

You can change the following settings during the game:

  • Player Name – Change your name in the settings menu.
  • Difficulty Level – Choose from the following difficulty levels:
    • Easy (default)
    • Medium
    • Hard These settings will affect the complexity of the questions you will encounter during the games.

Code status:

Maintainability

Game demonstration

asciicast