1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Position::to_fen(): fix a bug in side to move representation

Was introduced almost two months ago in patch:
"Space inflate Position::to_fen()"

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2008-11-15 08:27:52 +01:00
parent 3c05bd70eb
commit f4758ced90

View file

@ -243,7 +243,7 @@ const std::string Position::to_fen() const {
fen += (rank > RANK_1 ? '/' : ' '); fen += (rank > RANK_1 ? '/' : ' ');
} }
fen += (sideToMove == WHITE ? 'w' : 'b') + ' '; fen += (sideToMove == WHITE ? "w " : "b ");
if (castleRights != NO_CASTLES) if (castleRights != NO_CASTLES)
{ {
if (can_castle_kingside(WHITE)) fen += 'K'; if (can_castle_kingside(WHITE)) fen += 'K';
@ -291,9 +291,9 @@ void Position::print(Move m) const {
} }
std::cout << '|' << std::endl; std::cout << '|' << std::endl;
} }
std::cout << "+---+---+---+---+---+---+---+---+" << std::endl; std::cout << "+---+---+---+---+---+---+---+---+" << std::endl
std::cout << "Fen is: " << to_fen() << std::endl; << "Fen is: " << to_fen() << std::endl
std::cout << key << std::endl; << "Key is: " << key << std::endl;
} }