Add tt node in case of best score >= alpha
This commit is contained in:
@@ -4,7 +4,12 @@ use crate::{
|
||||
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(
|
||||
game: &mut Game,
|
||||
@@ -99,6 +104,14 @@ pub fn negamax(
|
||||
best_move,
|
||||
Bound::Upper,
|
||||
));
|
||||
} else {
|
||||
tt.insert(TTEntry::new(
|
||||
game.hash,
|
||||
depth,
|
||||
best_score,
|
||||
best_move,
|
||||
Bound::Exact,
|
||||
));
|
||||
}
|
||||
|
||||
(best_move, best_score)
|
||||
|
||||
Reference in New Issue
Block a user