mdzahan@edu.aau.at
Java arithmetic game

Details about: Java arithmetic game

Abstract

Get started with project called etaMath arithmetic game, the game that is designed to improve the cognitive abilities of the human brain. In this game the user will get 20 different arithmetic questions to answer. The maximum duration of each question is 10 seconds. At end of the game, the rank will. given to the user based on total corrected answer and duration of the answer.

Files

This game contains flowing files:

  • BasicRules.java
  • MathQuestions.java
  • results.json

BasicRules.java : is the java interface that contains two methods, such as:
void WaitforAnswer(int param).
void getMath(int param).

Game.java: is the java class file that controls user’s interation with the game. It is also shows the game history when user presse “2”.

MathQuestions.java: is the java class file which generate random math question. It also displays
the current results of the game and adds these results to the json file.

results.json: is the json file that stores the results of the game in json format. This file contains some test data that can be deleted. The json format follows the following pattern:

[{“Players”:{“Accuracy”:double,”Total Corrected Answer”:int,”Playing Time”:”date 2019″,”Play
Duration”: double,”Place”:int,”Player Name”:”String”}},{“Players”:{“”}},………n]

This game also includes json-simple-1.1.1.jar that manages the json file in java. The json-simple-
1.1.1.jar is located inside the resources directory.

How it works

Initially, the user will ask you to press “1”, “2” or “3”. If the user presses “1”, then the game will
start with 20 random math questions. Each question will wait 10 seconds. If the user can correct
a single question, then the user information will store the json file. In the end of the game
following information will display:
Type 1 to start a game
Type 2 to see highscores
Type 3 to exit the game

At this point, if the user presses “1”, then the new game will start again. If the user presses “2”,
the history of the game will be displayed in the console window as order by highest first. If the
user presses “3”, then the game will terminate.

Key Information
Developer
DI Md Sarwar Zahan
Project owner
Alpscron
Released
09 January 2019
Last Update:
06 May 2019
Version
1.1.0
Used IDE
Intellij Community 2018
Framework
jdk 11.0
Category
Console
Language
java 11