operator[]('B') = WB; operator[]('b') = BB;
operator[]('N') = WN; operator[]('n') = BN;
operator[]('P') = WP; operator[]('p') = BP;
operator[]('B') = WB; operator[]('b') = BB;
operator[]('N') = WN; operator[]('n') = BN;
operator[]('P') = WP; operator[]('p') = BP;
assert(to == ep_square());
assert(piece_on(from) == piece_of_color_and_type(us, PAWN));
assert(piece_on(capsq) == piece_of_color_and_type(them, PAWN));
assert(to == ep_square());
assert(piece_on(from) == piece_of_color_and_type(us, PAWN));
assert(piece_on(capsq) == piece_of_color_and_type(them, PAWN));
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
assert(to == st->epSquare);
assert(relative_rank(opposite_color(them), to) == RANK_6);
assert(to == st->epSquare);
assert(relative_rank(opposite_color(them), to) == RANK_6);
// Update board array
Piece king = piece_of_color_and_type(us, KING);
Piece rook = piece_of_color_and_type(us, ROOK);
// Update board array
Piece king = piece_of_color_and_type(us, KING);
Piece rook = piece_of_color_and_type(us, ROOK);
do_move_bb(&(byTypeBB[0]), move_bb); // HACK: byTypeBB[0] == occupied squares
board[from] = piece_of_color_and_type(us, pt);
do_move_bb(&(byTypeBB[0]), move_bb); // HACK: byTypeBB[0] == occupied squares
board[from] = piece_of_color_and_type(us, pt);
assert(!ep || square_is_empty(capsq));
// Restore the captured piece
set_bit(&(byColorBB[them]), capsq);
assert(!ep || square_is_empty(capsq));
// Restore the captured piece
set_bit(&(byColorBB[them]), capsq);
- index[capsq] = pieceCount[them][st->capture] - 1;
- pieceList[them][st->capture][index[capsq]] = capsq;
+ index[capsq] = pieceCount[them][st->capturedType] - 1;
+ pieceList[them][st->capturedType][index[capsq]] = capsq;
board[rfrom] = piece_of_color_and_type(us, ROOK);
board[kfrom] = piece_of_color_and_type(us, KING);
board[rfrom] = piece_of_color_and_type(us, ROOK);
board[kfrom] = piece_of_color_and_type(us, KING);
Square capQq = (side_to_move() == WHITE)? (to - DELTA_N) : (to - DELTA_S);
capture = piece_on(capQq);
Square capQq = (side_to_move() == WHITE)? (to - DELTA_N) : (to - DELTA_S);
capture = piece_on(capQq);
memset(index, 0, sizeof(int) * 64);
for (int i = 0; i < 64; i++)
memset(index, 0, sizeof(int) * 64);
for (int i = 0; i < 64; i++)