In my go program (GoFigure), I use a global alpha-beta search with
transpostion table. The transposition table is rotationally
invariant, and maintained across invocations of the program, which
results in walking of the game tree in ways that seem good at
demonstrating subtle problems with my code and my understanding of
alpha-beta search.
My alpha-beta function (simplified) looks something like this:
alphabeta(int alpha, int beta, int depth) {
check_transposition_table();
get_moves();
score_type = ALPHA_CUTOFF;
for (int i = 0; i < children.length; i++) {
children[i].alphabeta(beta, alpha, depth + 1);
if (child.score > score) {
score = child.score;
score_type = EXACT_SCORE;
}
The above is correct only if 'score' initial value is 'alpha' (or
greater); otherwise, it is possible to have a 'score' value lower than
'alpha', ie an alpha cutoff and not an exact score. Maybe a better code is :