Add one killer move per ply
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user