From: ianfab Date: Wed, 22 Aug 2018 19:58:45 +0000 (+0200) Subject: More robust shogi move parsing X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3b52410d4dbb3d7af526c28934af5204c04f43f8;p=fairystockfish.git More robust shogi move parsing Allow optional equals sign at end of move string. --- diff --git a/src/uci.cpp b/src/uci.cpp index d17a467..ec8c044 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -316,8 +316,15 @@ string UCI::move(const Position& pos, Move m) { Move UCI::to_move(const Position& pos, string& str) { - if (str.length() == 5) // Junior could send promotion piece in uppercase - str[4] = char(tolower(str[4])); + if (str.length() == 5) + { + if (str[4] == '=') + // shogi moves refraining from promotion might use equals sign + str.pop_back(); + else + // Junior could send promotion piece in uppercase + str[4] = char(tolower(str[4])); + } for (const auto& m : MoveList(pos)) if (str == UCI::move(pos, m))