https://github.com/msarchet/panzer/blob ... search.cpp you can see my code here.
Ignore the bits for the transposition table as they are not used, and currently not implemented correctly.
What happens is I end up with these kind of scores when searching from the startpos for white
go depth 3
info depth 1 score 1662 g1f3
info depth 2 score 1837 g1f3
info depth 3 score 32767 g1f3 <--- This is INT16_MAX
bestmove g1f3
I'm doing a full window search right now.
This worked for me fine when I was using separate Min and Max function so I'm not sure what I implemented incorrectly.
My code works by calling an iterative deepening function to check all of the depths, and to help with bestmove ordering. In my iterative search I call
Code: Select all
makeMove(move)
if (!InCheck)
{
score = -AlphaBetaMinMax(board, -beta, -alpha, depth);
}
unmakeMove(move)
if (score > alpha) {
score = alpha;
bestMove = move;
}
Code: Select all
if (depth == 0)
{
auto eval = QSearch(board, alpha, beta);
return eval;
}
for (moves)
{
makemove(move);
if (!inCheck)
{
score = -AlphaBetaMinMax(board, -beta, -alpha, depth - 1);
if (score > alpha)
{
if (score >= beta)
{
unmakeMove(move);
return beta;
}
alpha = score;
}
}
}
return alpha;
Clearly I am not understanding something correctly, and would appreciate some guidance, as I feel like I'm floundering around trying to understand what I am doing incorrectly.
