From ea594ce74a3013d0d186a272e2890493bfefea24 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sun, 12 Jan 2020 21:35:03 +0100 Subject: [PATCH] Implement XBoard Betza notation for castling --- src/ucioption.cpp | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/ucioption.cpp b/src/ucioption.cpp index c01c30f..c5e119a 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -73,12 +73,15 @@ void on_variant_change(const Option &o) { << " " << v->startFen << sync_endl; // Send piece command with Betza notation + // https://www.gnu.org/software/xboard/Betza.html for (PieceType pt : v->pieceTypes) { string suffix = pt == PAWN && v->doubleStep ? "ifmnD" : pt == KING && v->cambodianMoves ? "ismN" : pt == FERS && v->cambodianMoves ? "ifnD" : ""; + if (pt == KING && v->castling) + suffix += "O" + std::to_string((v->castlingKingsideFile - v->castlingQueensideFile) / 2); if (v->pieceDrops) { if (pt == PAWN && !v->firstRankPawnDrops) -- 1.7.0.4