cd build
./LinearEquationSolver.out
(Windows still a possibility, e.g. Visual Studio)
g++ -c src/*.cpp && mv *.o build
g++ build/*.o -o build/LinearEquationSolver.out
What if you could simulate the whole play and anticipate who'll win?
Project was invented by the Faculty of Algorithms ... bla, bla, bla ...
You have one dimensional gameboard, where are 2 players.
Each one rolls a dice (1-6 points), then he jumps to the field, he (pseudo)randomly rolled.
The look of our board is hardcoded in GameState.cpp in setPenalties() function.
By default each field has a value of 1, but some of the fields may contain penalties.
If you hit the penalty with value n, you need to go n fields back.
We are calculating what is the probability(chance) of 1st player winning the game (reaching the finish line).
The algorithm is generating a linear equation for each gamestate, then every equation is put into a squared matrix.
For example:
- a - position of the first player
- b - posiiton of the second player
- g - which player is currently rolling a dice
Then we can write this function as follows:
x(g,a,b);
- Gauss–Seidel method - the method of successive displacement -> iterative method
- Gaussian Elimination method
- Monte Carlo simulation with different number of iterations
- Update README with compilation guide + Linux support
- Describe each file in details
..............................................