flok99

Untitled

Aug 30th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. hash_type calculate_pawn_hash() const {
  2. hash_type hash_value = 0;
  3. for (Color c : constants::COLORS) {
  4. Bitboard bb = piece_type_bb(constants::PAWN, c);
  5. while (bb) {
  6. hash_value ^= zobrist::piece_square_key(bb.forward_bitscan(), pt, c);
  7. bb.forward_popbit();
  8. }
  9. }
  10. auto ep_sq = enpassant_square();
  11. if (ep_sq) {
  12. hash_value ^= zobrist::enpassant_key(*ep_sq);
  13. }
  14. hash_value ^= zobrist::side_to_move_key(side_to_move());
  15. return hash_value;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment