X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fnotation.cpp;h=85b0abdd2914e6c268da8408cc888de0828f3b5b;hp=db5f58b90d3099e1eae631d33cefca8791227d3d;hb=894c43a1d648d4cf160de006bde59aa5b6ba0190;hpb=e304db9d1ecf6a2318708483c90fadecf4fac4ee diff --git a/src/notation.cpp b/src/notation.cpp index db5f58b9..85b0abdd 100644 --- a/src/notation.cpp +++ b/src/notation.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "movegen.h" #include "notation.h" @@ -28,7 +28,7 @@ using namespace std; -static const char* PieceToChar[COLOR_NB] = { "PNBRQK", "pnbrqk" }; +static const char* PieceToChar[COLOR_NB] = { " PNBRQK", " pnbrqk" }; /// score_to_uci() converts a value to a string suitable for use with the UCI @@ -108,7 +108,7 @@ const string move_to_san(Position& pos, Move m) { if (m == MOVE_NULL) return "(null)"; - assert(pos.move_is_legal(m)); + assert(MoveList(pos).contains(m)); Bitboard attackers; bool ambiguousMove, ambiguousFile, ambiguousRank; @@ -226,7 +226,7 @@ string pretty_pv(Position& pos, int depth, Value value, int64_t msecs, Move pv[] const int64_t K = 1000; const int64_t M = 1000000; - StateInfo state[MAX_PLY_PLUS_2], *st = state; + std::stack st; Move* m = pv; string san, padding; size_t length; @@ -261,7 +261,8 @@ string pretty_pv(Position& pos, int depth, Value value, int64_t msecs, Move pv[] s << san << ' '; length += san.length() + 1; - pos.do_move(*m++, *st++); + st.push(StateInfo()); + pos.do_move(*m++, st.top()); } while (m != pv)