From ebb0a79962712740aafeb1efe116f4d66ac19183 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 12 Mar 2025 18:45:05 +0100 Subject: [PATCH] small changes in UCILoop --- source/uci.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/source/uci.cpp b/source/uci.cpp index 9d4a6d2..df80e11 100644 --- a/source/uci.cpp +++ b/source/uci.cpp @@ -7,7 +7,6 @@ #include "movegen.h" #include "search.h" #include "benchmark.h" -#include #include "tt.h" #include "perft.h" #include "utils.h" @@ -89,25 +88,11 @@ static void PrintEngineInfo() { } void UCILoop(Board &board) { - // reset STDIN & STDOUT buffers - setbuf(stdin, NULL); - setbuf(stdout, NULL); - - // define user / GUI input buffer std::string input = ""; // main loop while (true) { - // reset user / GUI input - getline(std::cin, input); - - // make sure output reaches the GUI - fflush(stdout); - - // make sure input is available - if (input[0] == '\n') { - continue; - } + std::getline(std::cin, input); // parse UCI "isready" command if (input.find("isready") != std::string::npos) {