20-add-negamax-eval-function #31

Merged
Josh merged 9 commits from 20-add-negamax-eval-function into main 2025-08-26 00:28:03 +00:00
Showing only changes of commit 60a987a7a1 - Show all commits

View File

@@ -715,6 +715,14 @@ bool apply_move_on_copy(struct Board *in, struct Board *out, struct Move m) {
in->castling_rights, m.piece, m.from, m.to, captured_pid in->castling_rights, m.piece, m.from, m.to, captured_pid
); );
// Apply full and half move clock counts.
bool is_capture = (m.flags & MF_CAPTURE) || (m.flags & MF_ENPASSANT);
bool is_pawn = (m.piece == P) || (m.piece == p);
out->halfmove_clock = (is_capture || is_pawn) ? 0 : in->halfmove_clock + 1;
out->fullmove_number = in->fullmove_number + (in->side_to_move == BLACK);
// Side to move flips // Side to move flips
out->side_to_move = opp; out->side_to_move = opp;