Add one killer move per ply

This commit is contained in:
stefiosif
2025-01-27 22:21:21 +02:00
parent b4f61f6504
commit ccba6451aa
6 changed files with 39 additions and 7 deletions

View File

@@ -53,7 +53,12 @@ pub fn negamax(
}
moves.sort_unstable_by_key(|mv| {
score_move(&game.mailbox, *mv, tt_entry.and_then(|entry| entry.mv))
score_move(
&game.mailbox,
*mv,
game.killer[plies as usize],
tt_entry.and_then(|entry| entry.mv),
)
});
for mv in moves {
@@ -88,6 +93,9 @@ pub fn negamax(
}
if score >= beta {
if !mv.is_capture() {
game.killer[plies as usize] = Some(mv);
}
break;
}
}