You are right Michael, the posted code is not the Q-Search. I wanted to get TTs first running in the normal search. I figured out how to use the bestmove first. Now i can play around with prunning and updating the bounds.....your code snippet looks fine, thx.Well, if i now look at your last post and its code, i assume
you only retrieve the bestmove from TT instead of prun sth.
That is ok imo when this is a quiescence routine. (i assume it is).
But if so, where is your standpat condition ?
And what is the difference between
"alphabeta_qs_mvvlva_tt" and ?
"alphabeta_qsearch_mvvlva_tt" ?
Code: Select all
//totally missing now is _exact_ score
if(tt->flag == -1) {return(tt->score);} Because the actual depth could be deeper (no iterative deepeing) i should compute further?
Code: Select all
/* 1 => Lower bound, Fail high */
/* 0 => Exsact Score, alpha was increased */
/* -1 => Upper bound, Fail low */
tt = &TT[hash>>core_bit];
if (tt->hash == hash && tt->depth >= max_depth-depth+PLY) {
if (tt->flag == 1) {
if(tt->score >= beta) return(tt->score);
/* alpha = MAX(alpha, tt->score); */
}
if (tt->flag == -1) {
if(tt->score <= alpha) return(tt->score);
/* beta = MIN(beta, tt->score); */
}
if ( tt->flag >= 0) {
moves[movecounter] = tt->bestmove;
movecounter++;
}
}
