Probe TT at each negamax recursion and store entries based on bounds
This commit is contained in:
@@ -57,10 +57,11 @@ impl Game {
|
||||
let color = board.state.current_player();
|
||||
let pawn_move = board.is_pawn_move(mv.src);
|
||||
let mut en_passant_square = None;
|
||||
let capture_en_passant = match color {
|
||||
Color::White => mv.dst - 8,
|
||||
let ep_capture = match color {
|
||||
Color::White => mv.dst.saturating_sub(8),
|
||||
Color::Black => mv.dst + 8,
|
||||
};
|
||||
|
||||
let old_castling_ability = board.state.castling_ability;
|
||||
|
||||
let piece_at_src = mailbox
|
||||
@@ -84,11 +85,11 @@ impl Game {
|
||||
}
|
||||
MoveType::EnPassant => {
|
||||
board.move_piece(mv.src, mv.dst, PieceType::Pawn);
|
||||
board.remove_opponent_piece(capture_en_passant, PieceType::Pawn);
|
||||
hash.update_en_passant(mv.src, mv.dst, capture_en_passant, color);
|
||||
board.remove_opponent_piece(ep_capture, PieceType::Pawn);
|
||||
hash.update_en_passant(mv.src, mv.dst, ep_capture, color);
|
||||
hash.drop_en_passant_hash(board.state.en_passant_square());
|
||||
mailbox.set_piece_at(mv.dst, Some(PieceType::Pawn));
|
||||
mailbox.set_piece_at(capture_en_passant, None);
|
||||
mailbox.set_piece_at(ep_capture, None);
|
||||
}
|
||||
MoveType::DoublePush => {
|
||||
board.move_piece(mv.src, mv.dst, piece_at_src);
|
||||
|
||||
Reference in New Issue
Block a user