Merge in init_zobrist() and rename the latter.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
// Startup initializations
init_bitboards();
// Startup initializations
init_bitboards();
- Position::init_zobrist();
- Position::init_piece_square_tables();
init_kpk_bitbase();
init_search();
Threads.init();
init_kpk_bitbase();
init_search();
Threads.init();
-/// Position::init_zobrist() is a static member function which initializes at
-/// startup the various arrays used to compute hash keys.
+/// Position::init() is a static member function which initializes at
+/// startup the various arrays used to compute hash keys and the piece
+/// square tables. The latter is a two-step operation: First, the white
+/// halves of the tables are copied from the MgPST[][] and EgPST[][] arrays.
+/// Second, the black halves of the tables are initialized by mirroring
+/// and changing the sign of the corresponding white scores.
-void Position::init_zobrist() {
zobSideToMove = rk.rand<Key>();
zobExclusion = rk.rand<Key>();
zobSideToMove = rk.rand<Key>();
zobExclusion = rk.rand<Key>();
-}
-
-
-/// Position::init_piece_square_tables() initializes the piece square tables.
-/// This is a two-step operation: First, the white halves of the tables are
-/// copied from the MgPST[][] and EgPST[][] arrays. Second, the black halves
-/// of the tables are initialized by mirroring and changing the sign of the
-/// corresponding white scores.
-
-void Position::init_piece_square_tables() {
for (Square s = SQ_A1; s <= SQ_H8; s++)
for (Piece p = WP; p <= WK; p++)
for (Square s = SQ_A1; s <= SQ_H8; s++)
for (Piece p = WP; p <= WK; p++)
// Position consistency check, for debugging
bool is_ok(int* failedStep = NULL) const;
// Position consistency check, for debugging
bool is_ok(int* failedStep = NULL) const;
- // Static member functions
- static void init_zobrist();
- static void init_piece_square_tables();
+ // Global initialization
+ static void init();