Add tt node in case of best score >= alpha

This commit is contained in:
stefiosif
2024-11-10 14:17:55 +02:00
parent c724eca21c
commit e2d3185bbe

View File

@@ -4,7 +4,12 @@ use crate::{
movegen::r#move::Move, movegen::r#move::Move,
}; };
use super::{move_ordering::score_by_mvv_lva, quiescence::quiescence, transposition_table::{Bound, TTEntry, TranspositionTable}, QUIESCENCE_DEPTH}; use super::{
move_ordering::score_by_mvv_lva,
quiescence::quiescence,
transposition_table::{Bound, TTEntry, TranspositionTable},
QUIESCENCE_DEPTH,
};
pub fn negamax( pub fn negamax(
game: &mut Game, game: &mut Game,
@@ -99,6 +104,14 @@ pub fn negamax(
best_move, best_move,
Bound::Upper, Bound::Upper,
)); ));
} else {
tt.insert(TTEntry::new(
game.hash,
depth,
best_score,
best_move,
Bound::Exact,
));
} }
(best_move, best_score) (best_move, best_score)