aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-11 10:24:07 +0200
committerAdam <adammegarules1@gmail.com>2026-08-11 10:24:07 +0200
commit2ea44ddd221433e457d5118d205449d4a289488b (patch)
tree7a9a5cefebda09a68772ced86198fca12fc0d00e /src/uci.cpp
parent105935a1d69aad252747d0ddb058f1971af01c17 (diff)
simpilifed code
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp18
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;