Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hash_type calculate_pawn_hash() const {
- hash_type hash_value = 0;
- for (Color c : constants::COLORS) {
- Bitboard bb = piece_type_bb(constants::PAWN, c);
- while (bb) {
- hash_value ^= zobrist::piece_square_key(bb.forward_bitscan(), pt, c);
- bb.forward_popbit();
- }
- }
- auto ep_sq = enpassant_square();
- if (ep_sq) {
- hash_value ^= zobrist::enpassant_key(*ep_sq);
- }
- hash_value ^= zobrist::side_to_move_key(side_to_move());
- return hash_value;
- }
Advertisement
Add Comment
Please, Sign In to add comment