This side project was to produce a fully functional GUI Othello engine. This was initially set as a challenge during an MSc tutorial to produce an Othello engine using minimax. I built a working engine (initially in the command line) and have since produced a GUI for it.
When I redesigned it using a GUI, I decided to attempt to implement MVC, as a way of learning MVC. This could also make it easier to further extend the game in future.
The aim and of the game is simple - to have the most discs of your colour on the board at the end of the game. The rules are also relatively simple. On your turn you can play one disc on any square which is adjacent to an opponents disc, providing it is possible to ‘draw a straight line’ between your disc, and another of your discs, with all squares inbetween the two discs of your colour occupied by your opponents colour.
While this sounds relatively simple, there are some general strategy points worth considering:
This game comes with 3 game modes:
The engine is playing using a minimax strategy (currently set at depth 5). It attempts to follow the tactics listed above. It does this by minimising future moves for its opponent, while maximising them for itself, then applying a points-based grading strategy to the board for each leaf of the tree. The grading strategy is as follows:
[ [10, -2, 2, 2, 2, 2, -2, 10],
[-2, -2, 1, 1, 1, 1, 1, -2],
[2, 1, 1, 1, 1, 1, 1, 2],
[2, 1, 1, 1, 1, 1, 1, 2],
[2, 1, 1, 1, 1, 1, 1, 2],
[2, 1, 1, 1, 1, 1, 1, 2],
[-2, -2, 1, 1, 1, 1, -2, -2],
[10, -2, 2, 2, 2, 2, -2, 10]]
The points are centered around 0, with a positive score meaning the engine has the advantage, and a negative score meaning the player has an advantage.