- // Indices to the Random64[] array
- const int PieceIdx = 0;
- const int CastleIdx = 768;
- const int EnPassantIdx = 772;
- const int TurnIdx = 780;
-
- // Local functions
- uint64_t book_key(const Position& pos);
- uint64_t book_piece_key(Piece p, Square s);
- uint64_t book_castle_key(const Position& pos);
- uint64_t book_ep_key(const Position& pos);
- uint64_t book_color_key(const Position& pos);
-}
-
-
-////
-//// Functions
-////
-
-// C'tor. Make random number generation less deterministic, for book moves
-Book::Book() {
-
- for (int i = abs(get_system_time() % 10000); i > 0; i--)
- RKiss.rand<unsigned>();
-}
-
-
-/// Destructor. Be sure file is closed before we leave.
-
-Book::~Book() {
-
- close();
-}
-
-
-/// Book::close() closes the file only if it is open, otherwise
-/// we can end up in a little mess due to how std::ifstream works.
-
-void Book::close() {
-
- if (is_open())
- ifstream::close();
-}
+ // Offsets to the PolyGlotRandoms[] array of zobrist keys
+ const Key* ZobPiece = PolyGlotRandoms + 0;
+ const Key* ZobCastle = PolyGlotRandoms + 768;
+ const Key* ZobEnPassant = PolyGlotRandoms + 772;
+ const Key* ZobTurn = PolyGlotRandoms + 780;