Fix FEN of nCheck variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 9 Mar 2019 22:29:05 +0000 (23:29 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 10 Mar 2019 09:54:16 +0000 (10:54 +0100)
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

index 21c8e74..03d8c26 100644 (file)
@@ -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;