Author: Aivaras Juzvikas
Date: 10:02:27 03/11/04
taken from http://www.brucemo.com/compchess/programming/hashing.htm
int AlphaBeta(int depth, int alpha, int beta)
{
int hashf = hashfALPHA;
if ((val = ProbeHash(depth, alpha, beta)) != valUNKNOWN)
return val;
if (depth == 0) {
val = Evaluate();
RecordHash(depth, val, hashfEXACT); /* 1 */
return val;
}
GenerateLegalMoves();
while (MovesLeft()) {
MakeNextMove();
val = -AlphaBeta(depth - 1, -beta, -alpha);
UnmakeMove();
if (val >= beta) {
RecordHash(depth, beta, hashfBETA);
return beta;
}
if (val > alpha) {
hashf = hashfEXACT;
alpha = val;
}
}
RecordHash(depth, alpha, hashf);
return alpha;
}
ok ive pretty much implemented this and what i get is:
if i exclude /* 1 */ marked line i get very low successful tt hits (below 4%)
but my program plays well ie. not any worse than it did before i added hash
tables
if i include that line i get higher tt hit ratio (~25%) but the program
occasionaly makes a very dumb move.
am i missing smth or theres a bug in this pseudo code ?
another question: do u record values from qsearch?
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.