From: Fabian Fichter Date: Thu, 30 Jan 2020 20:44:43 +0000 (+0100) Subject: Support USI extensions X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=20f941f9c8cc0dd155a655a2e473fd0e371bf09d;p=fairystockfish.git Support USI extensions Improve Shogi GUI compatibility by supporting: - bestmove resign - go byoyomi Closes #71. --- diff --git a/src/uci.cpp b/src/uci.cpp index 2b4054f..c55a08f 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -142,6 +142,15 @@ namespace { else if (token == "opptime") is >> limits.time[~pos.side_to_move()]; else if (token == "increment") is >> limits.inc[pos.side_to_move()]; else if (token == "oppinc") is >> limits.inc[~pos.side_to_move()]; + // USI commands + else if (token == "byoyomi") + { + int byoyomi = 0; + is >> byoyomi; + limits.inc[WHITE] = limits.inc[BLACK] = byoyomi; + limits.time[WHITE] += byoyomi; + limits.time[BLACK] += byoyomi; + } Threads.start_thinking(pos, states, limits, ponderMode); } @@ -366,7 +375,7 @@ string UCI::move(const Position& pos, Move m) { Square to = to_sq(m); if (m == MOVE_NONE) - return "(none)"; + return Options["Protocol"] == "usi" ? "resign" : "(none)"; if (m == MOVE_NULL) return "0000";