X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=b7f72d9d4c8cb655df23ef9822f40724502e9d7b;hp=d7c65e10e066810811def3763f3685c24ca10492;hb=c2600a73cfcde2958351bf7fd4dc7296b137223b;hpb=dab1cd8af9c95c119500e97920f927ae4aafc24f diff --git a/src/uci.cpp b/src/uci.cpp index d7c65e10..b7f72d9d 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -28,6 +28,7 @@ #include "move.h" #include "position.h" #include "search.h" +#include "thread.h" #include "ucioption.h" using namespace std; @@ -58,20 +59,23 @@ void uci_loop() { Position pos(StarFEN, false, 0); // The root position string cmd, token; + bool quit = false; - while (getline(cin, cmd)) + while (!quit) { + Threads.getline(cmd); + istringstream is(cmd); is >> skipws >> token; if (token == "quit") - break; + quit = true; - if (token == "go" && !go(pos, is)) - break; + else if (token == "go") + quit = !go(pos, is); - if (token == "ucinewgame") + else if (token == "ucinewgame") pos.from_fen(StarFEN, false); else if (token == "isready") @@ -90,7 +94,7 @@ void uci_loop() { pos.print(); else if (token == "flip") - pos.flip(); + pos.flip_me(); else if (token == "eval") {