KalahaGo

KalahaGo is a game I wrote as an university project. It's based on the popular board game Kalaha, which is also often referred to as Mancala. It includes an AI opponent that is a lot better than me and features a colorful UI with several settings that can be tweaked.

Creating KalahaGo came with multiple steps and challenges involved. At first I created the GUI in JavaFX with help of the SceneBuilder tool. After that I designed the overall structure of the classes before implementing the game logic as well as the AI opponent.

Arguably the biggest challenge while writing KalahaGo was Performance. When working with the Minimax Algorithm and the tree structure that comes with it, you’re easily dealing with hundreds of thousands of nodes. Based on the assignment I had to deal with an O(3n) runtime efficiency because I had to build up the tree with every move, analyze every node for its rating and write a Log-File documenting the tree information. These three steps had to be executed in this order, because step 2 needed the tree to be already built and step 3 needed the rating to be complete.

Doing calculations for 100.000 nodes is a pain in the ass performance wise. Doing calculations for 100.000 nodes three times doesn’t make it any better. I was able to get it down to O(2n) by combining Minimax and building the tree. On my way down the tree I added the nodes that needed to be added. Once the tree was complete I recursively returned the ratings from the bottom of the tree to the top where I needed them.

The Game itself and a full documentation is available on my GitHub Page.