What is the game about? Looking into the algorithm Looking into the code Complexity and conclusions
Board game 2-4 players and requires a dice Objective of the game?
We divided the algorithm into 4 parts › Game configuration › Lojtar Ushtar › Game control panel › Graphics
index = f(key, array_size) We create a hash map with keys name of the colors and the value of the colors. Complexity of the creation of this hash is O(n).
We have created functions that get the colors and the coordinates of the boxes. These functions are trivial and don’t effect the complexity.
We initialize an array named Ushtaret with 4 elements. for(int i=0; i<4; i++){ ushtaret [i]=new Ushtar(GameConfig.getInstance().getColor(index),index); We also create a function to see if a player has soldiers in the game: for(int i=0; i<4; i++){ if (ushtaret[i].isSelectable() && ushtaret[i].getIndex()>=0) return true;
In this file we also have the functions to get the number of soldiers Set and get the goals and increase the goals
The main functions are the ones that set and get the index value of the soldier position Also it has some functions which don’t effect the complexity such as creating the soldier form and color
This file has the functions that create the main game panel which contains the buttons, labels etc. This is the part where the dice roll is created
The graphics is divided in separate files which interact with each other. Creates the main board where the game takes place