X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=918d50e505e0d1e9ab8cb4b5b15f11c6d38d81ec;hp=ba399b128c45ea7ab30c4440d71682fe1817ba25;hb=8a7876d48d4360d14d918c1ff444b5d6eb0382de;hpb=428962a2e8c754311119fa4f66c7c248d63cb2c8 diff --git a/src/position.cpp b/src/position.cpp index ba399b12..918d50e5 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -25,25 +25,21 @@ #include "bitcount.h" #include "movegen.h" -#include "notation.h" #include "position.h" #include "psqtab.h" #include "rkiss.h" #include "thread.h" #include "tt.h" +#include "uci.h" using std::string; -static const string PieceToChar(" PNBRQK pnbrqk"); - CACHE_LINE_ALIGNMENT Value PieceValue[PHASE_NB][PIECE_NB] = { { VALUE_ZERO, PawnValueMg, KnightValueMg, BishopValueMg, RookValueMg, QueenValueMg }, { VALUE_ZERO, PawnValueEg, KnightValueEg, BishopValueEg, RookValueEg, QueenValueEg } }; -static Score psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; - namespace Zobrist { Key psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; @@ -57,6 +53,9 @@ Key Position::exclusion_key() const { return st->key ^ Zobrist::exclusion;} namespace { +const string PieceToChar(" PNBRQK pnbrqk"); +Score psq[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB]; + // min_attacker() is a helper function used by see() to locate the least // valuable attacker for the side to move, remove the attacker we just found // from the bitboards and scan for new X-ray attacks behind it. @@ -423,7 +422,7 @@ const string Position::fen() const { if (!can_castle(WHITE) && !can_castle(BLACK)) ss << '-'; - ss << (ep_square() == SQ_NONE ? " - " : " " + to_string(ep_square()) + " ") + ss << (ep_square() == SQ_NONE ? " - " : " " + UCI::format_square(ep_square()) + " ") << st->rule50 << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2; return ss.str(); @@ -450,7 +449,7 @@ const string Position::pretty() const { << std::setfill('0') << std::setw(16) << st->key << "\nCheckers: "; for (Bitboard b = checkers(); b; ) - ss << to_string(pop_lsb(&b)) << " "; + ss << UCI::format_square(pop_lsb(&b)) << " "; return ss.str(); }