X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.cpp;h=47e1af2704e3eb21e08026d09d2a3c0bbe5dd461;hb=62ab7e46124b12fdbb310a9c8a8072ad05fc51b8;hp=8390facc5b501a040333c820285bd28e15573a29;hpb=3c05bd70ebf57cebb88d29a88e6c492976a97761;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index 8390facc..47e1af27 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -39,6 +39,8 @@ //// Variables //// +extern SearchStack EmptySearchStack; + int Position::castleRightsMask[64]; Key Position::zobrist[2][8][64]; @@ -243,7 +245,7 @@ const std::string Position::to_fen() const { fen += (rank > RANK_1 ? '/' : ' '); } - fen += (sideToMove == WHITE ? 'w' : 'b') + ' '; + fen += (sideToMove == WHITE ? "w " : "b "); if (castleRights != NO_CASTLES) { if (can_castle_kingside(WHITE)) fen += 'K'; @@ -274,7 +276,8 @@ void Position::print(Move m) const { if (m != MOVE_NONE) { Position p(*this); - std::cout << "Move is: " << move_to_san(p, m) << std::endl; + std::string col = (color_of_piece_on(move_from(m)) == BLACK ? ".." : ""); + std::cout << "Move is: " << col << move_to_san(p, m) << std::endl; } for (Rank rank = RANK_8; rank >= RANK_1; rank--) { @@ -291,9 +294,9 @@ void Position::print(Move m) const { } std::cout << '|' << std::endl; } - std::cout << "+---+---+---+---+---+---+---+---+" << std::endl; - std::cout << "Fen is: " << to_fen() << std::endl; - std::cout << key << std::endl; + std::cout << "+---+---+---+---+---+---+---+---+" << std::endl + << "Fen is: " << to_fen() << std::endl + << "Key is: " << key << std::endl; } @@ -1913,8 +1916,7 @@ bool Position::is_mate() { if (is_check()) { - MovePicker mp = MovePicker(*this, false, MOVE_NONE, MOVE_NONE, - MOVE_NONE, MOVE_NONE, Depth(0)); + MovePicker mp = MovePicker(*this, false, MOVE_NONE, EmptySearchStack, Depth(0)); return mp.get_next_move() == MOVE_NONE; } return false;