terkill/Win — pull request #1 by samal84 (2014-03-12 15:34:13+00:00)
Title: Memoization

Implemented memoization in min/max.

In order for this to be efficient we needed a quick way to hash the board, and not store too large values in the memoization table, as there will be a lot of pairs in this table. This was solved by changing the representation of the board to bit arrays based on long values, and using these long values as keys to the utility value.

This was done because running over the board array every time is obviously time consuming. Storing the board in long value was possible because the board is less than 8*8, which is the larges board with binary values that can be stored in a 64 bit long. There are two longs, so one represents whether a coin is at a position or not, and the other represents its color.

I also implemented a compile time guard on the memoization calls in min/max, so that it can be compiled out, if we want.