small changes in UCILoop
This commit is contained in:
1 parent
09f648e1f8
commit
ebb0a79962
1 file changed
+1
-16
+1
-16
@@ -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) {
|
||||||
|
|||||||
Reference in new issue
Block a user