Code: Select all
if pondering
root_score = -search (-beta, -alpha, depth-2+extensions, TRUE);
I will try that, don't know if thats right.,
Moderator: Ras
Code: Select all
if pondering
root_score = -search (-beta, -alpha, depth-2+extensions, TRUE);
Code: Select all
When the search ends
Make the move on the board
Copy the board
make the second move of the PV on the copy
search the copy
Code: Select all
When the opponents play:
Make the opponents move on the board
if the engine pondered the right move
Mark the search as a real search instead of a ponder search
eventually make a move
else
stop the search
search the board
eventually make a move
end if
Code: Select all
make (&moves[0], i);
Code: Select all
if (do_null && null_red && piece_count >= 5 && depth >= null_red+1) {
/* update the rep_history just so things don't get funky: */
rep_history[game_ply++] = cur_pos;
fifty++;
xor (&cur_pos, color_h_values[0]);
xor (&cur_pos, color_h_values[1]);
xor (&cur_pos, ep_h_values[ep_square]);
xor (&cur_pos, ep_h_values[0]);
white_to_move ^= 1;
ply++;
ep_square = 0;
null_score = -search (-beta, -beta+1, depth-null_red-1, FALSE);
ep_square = ep_temp;
ply--;
white_to_move ^= 1;
game_ply--;
fifty--;
xor (&cur_pos, color_h_values[0]);
xor (&cur_pos, color_h_values[1]);
xor (&cur_pos, ep_h_values[ep_square]);
xor (&cur_pos, ep_h_values[0]);
assert (cur_pos.x1 == compute_hash ().x1 &&
cur_pos.x2 == compute_hash ().x2);
/* check to see if we ran out of time: */
if (time_exit)
return 0;
/* check to see if we can get a quick cutoff from our null move: */
if (null_score >= beta)
return beta;
if (null_score < -INF+10*maxdepth)
extensions++;
}