X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=eed6d8850873209fbf072e3a1968b783eb9f06d6;hp=ccc66d5ba79c6779177ad5d6ec672a7d318be5a1;hb=b8fd1a78dc69f9baba2d8b0079e2d7844fe62958;hpb=fbb53524efd94c4b227c72c725c628a4aa5f9f72 diff --git a/src/position.cpp b/src/position.cpp index ccc66d5b..eed6d885 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -24,10 +24,10 @@ #include #include "bitcount.h" +#include "misc.h" #include "movegen.h" #include "position.h" #include "psqtab.h" -#include "rkiss.h" #include "thread.h" #include "tt.h" #include "uci.h" @@ -123,7 +123,7 @@ std::ostream& operator<<(std::ostream& os, const Position& pos) { << std::setfill('0') << std::setw(16) << pos.st->key << std::dec << "\nCheckers: "; for (Bitboard b = pos.checkers(); b; ) - os << UCI::format_square(pop_lsb(&b)) << " "; + os << UCI::square(pop_lsb(&b)) << " "; return os; } @@ -137,15 +137,15 @@ std::ostream& operator<<(std::ostream& os, const Position& pos) { void Position::init() { - RKISS rk; + PRNG rng(1070372); for (Color c = WHITE; c <= BLACK; ++c) for (PieceType pt = PAWN; pt <= KING; ++pt) for (Square s = SQ_A1; s <= SQ_H8; ++s) - Zobrist::psq[c][pt][s] = rk.rand(); + Zobrist::psq[c][pt][s] = rng.rand(); for (File f = FILE_A; f <= FILE_H; ++f) - Zobrist::enpassant[f] = rk.rand(); + Zobrist::enpassant[f] = rng.rand(); for (int cr = NO_CASTLING; cr <= ANY_CASTLING; ++cr) { @@ -153,12 +153,12 @@ void Position::init() { while (b) { Key k = Zobrist::castling[1ULL << pop_lsb(&b)]; - Zobrist::castling[cr] ^= k ? k : rk.rand(); + Zobrist::castling[cr] ^= k ? k : rng.rand(); } } - Zobrist::side = rk.rand(); - Zobrist::exclusion = rk.rand(); + Zobrist::side = rng.rand(); + Zobrist::exclusion = rng.rand(); for (PieceType pt = PAWN; pt <= KING; ++pt) { @@ -444,7 +444,7 @@ const string Position::fen() const { if (!can_castle(WHITE) && !can_castle(BLACK)) ss << '-'; - ss << (ep_square() == SQ_NONE ? " - " : " " + UCI::format_square(ep_square()) + " ") + ss << (ep_square() == SQ_NONE ? " - " : " " + UCI::square(ep_square()) + " ") << st->rule50 << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2; return ss.str();