From e5a2577c931ffc99c955a1b02ca0091ad19f8a8d Mon Sep 17 00:00:00 2001 From: Rick Date: Wed, 5 Oct 2022 14:25:53 -0700 Subject: [PATCH] Update xboard.cpp - remove command Adding remove command xboard sends with CTRL+X, only sent when player's turn, go back two moves to players previous turn. Allows player to go back and try different moves without engine stopping like undo, see https://www.gnu.org/software/xboard/engine-intf.html#8 for differences between undo and remove. --- src/xboard.cpp | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/xboard.cpp b/src/xboard.cpp index 8368eb3..482b5e4 100644 --- a/src/xboard.cpp +++ b/src/xboard.cpp @@ -380,6 +380,17 @@ void StateMachine::process_command(std::string token, std::istringstream& is) { go(analysisLimits); } } + else if (token == "remove") + { + stop(); + if (moveList.size()) + { + undo_move(); + undo_move(); + if (Options["UCI_AnalyseMode"]) + go(analysisLimits); + } + } // Bughouse commands else if (token == "partner") Partner.parse_partner(is); @@ -482,4 +493,4 @@ void StateMachine::process_command(std::string token, std::istringstream& is) { } // namespace XBoard -} // namespace Stockfish \ No newline at end of file +} // namespace Stockfish -- 1.7.0.4