diff options
Diffstat (limited to 'src/uci.cpp')
| -rw-r--r-- | src/uci.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/uci.cpp b/src/uci.cpp index 29c544f..5a4726a 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -1,9 +1,7 @@ -#include <algorithm> #include <cassert> #include <cctype> #include <chrono> #include <cstdint> -#include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> @@ -12,7 +10,6 @@ #include <sstream> #include <string> #include <sys/types.h> -#include <type_traits> #include <unordered_map> #include "board/board.hpp" @@ -190,8 +187,7 @@ void Uci() { LogUci("GUI -> ENGINE: " + cmd); if (cmd == "quit") { - exit(0); - break; + return; } if (cmd == "board") { printBoard(&game); @@ -203,14 +199,17 @@ void Uci() { cout << "id name " << engine_version() << "\n"; cout << "uciok\n"; cout.flush(); - } else if (cmd == "ucinewgame") { + } + if (cmd == "ucinewgame") { game = initBoard("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", &transpositions); - } else if (cmd == "isready") { + } + if (cmd == "isready") { cout << "readyok\n"; cout.flush(); - } else if (cmd.starts_with("go")) { + } + if (cmd.starts_with("go")) { stringstream ss(cmd); string token; @@ -260,7 +259,8 @@ void Uci() { cout << "\n"; cout.flush(); - } else if (cmd.starts_with("position")) { + } + if (cmd.starts_with("position")) { stringstream ss(cmd); string token; |
