From 7367bb4c6986e17b141ca8409839c0a160a6ef20 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 9 Mar 2019 23:29:05 +0100 Subject: [PATCH] Fix FEN of nCheck variants 3check LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 515 W: 268 L: 208 D: 39 http://35.161.250.236:6543/tests/view/5c843ee36e23db76ed252591 3check 2threads LLR: 2.95 (-2.94,2.94) [-10.00,5.00] Total: 527 W: 270 L: 211 D: 46 http://35.161.250.236:6543/tests/view/5c84440f6e23db76ed252594 --- src/position.cpp | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 21c8e74..03d8c26 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -630,16 +630,21 @@ const string Position::fen() const { if (!can_castle(ANY_CASTLING)) ss << '-'; - // check count + // Counting limit or ep-square + if (st->countingLimit) + ss << " " << st->countingLimit << " "; + else + ss << (ep_square() == SQ_NONE ? " - " : " " + UCI::square(*this, ep_square()) + " "); + + // Check count if (max_check_count()) - ss << " " << (max_check_count() - st->checksGiven[WHITE]) << "+" << (max_check_count() - st->checksGiven[BLACK]); + ss << (max_check_count() - st->checksGiven[WHITE]) << "+" << (max_check_count() - st->checksGiven[BLACK]) << " "; - // Counting limit and counting ply, or ep-square and 50-move rule counter + // Counting ply or 50-move rule counter if (st->countingLimit) - ss << " " << st->countingLimit << " " << st->countingPly; + ss << st->countingPly; else - ss << (ep_square() == SQ_NONE ? " - " : " " + UCI::square(*this, ep_square()) + " ") - << st->rule50; + ss << st->rule50; ss << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2; -- 1.7.0.4