Io rework #15

Merged
rektdie merged 7 commits from IO_rework into legalMovegen 2025-03-12 19:42:20 +01:00
Showing only changes of commit ebb0a79962 - Show all commits
+1 -16
View File
@@ -7,7 +7,6 @@
#include "movegen.h" #include "movegen.h"
#include "search.h" #include "search.h"
#include "benchmark.h" #include "benchmark.h"
#include <cstring>
#include "tt.h" #include "tt.h"
#include "perft.h" #include "perft.h"
#include "utils.h" #include "utils.h"
@@ -89,25 +88,11 @@ static void PrintEngineInfo() {
} }
void UCILoop(Board &board) { void UCILoop(Board &board) {
// reset STDIN & STDOUT buffers
setbuf(stdin, NULL);
setbuf(stdout, NULL);
// define user / GUI input buffer
std::string input = ""; std::string input = "";
// main loop // main loop
while (true) { while (true) {
// reset user / GUI input std::getline(std::cin, input);
getline(std::cin, input);
// make sure output reaches the GUI
fflush(stdout);
// make sure input is available
if (input[0] == '\n') {
continue;
}
// parse UCI "isready" command // parse UCI "isready" command
if (input.find("isready") != std::string::npos) { if (input.find("isready") != std::string::npos) {