- result ^= book_piece_key(p, s);
- }
- }
- result ^= book_castle_key(pos);
- result ^= book_ep_key(pos);
- result ^= book_color_key(pos);
- return result;
- }
-
-
- uint64_t book_piece_key(Piece p, Square s) {
-
- /// Convert pieces to the range 0..11
- static const int PieceTo12[] = { 0, 0, 2, 4, 6, 8, 10, 0, 0, 1, 3, 5, 7, 9, 11 };
-
- return Random64[RandomPiece + (PieceTo12[int(p)]^1) * 64 + int(s)];
- }
-
-
- uint64_t book_castle_key(const Position& pos) {
-
- uint64_t result = 0ULL;