From: Marco Costalba Date: Mon, 29 Jul 2013 17:33:30 +0000 (+0200) Subject: Tidy up Position::pretty X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=cc608a7aba8c1a98838f6d61e78ffacfc16b48cd Tidy up Position::pretty No functional change. --- diff --git a/src/position.cpp b/src/position.cpp index 60d619be..5dc94a63 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -392,16 +392,18 @@ const string Position::pretty(Move move) const { string brd = twoRows + twoRows + twoRows + twoRows + dottedLine; + for (Bitboard b = pieces(); b; ) + { + Square s = pop_lsb(&b); + brd[513 - 68 * rank_of(s) + 4 * file_of(s)] = PieceToChar[piece_on(s)]; + } + std::ostringstream ss; if (move) ss << "\nMove: " << (sideToMove == BLACK ? ".." : "") << move_to_san(*const_cast(this), move); - for (Square sq = SQ_A1; sq <= SQ_H8; sq++) - if (piece_on(sq) != NO_PIECE) - brd[513 - 68*rank_of(sq) + 4*file_of(sq)] = PieceToChar[piece_on(sq)]; - ss << brd << "\nFen: " << fen() << "\nKey: " << std::hex << std::uppercase << std::setfill('0') << std::setw(16) << st->key << "\nCheckers: ";