X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=dbf735af15a018b487a9b0df4574e60534fa89ae;hp=d7c65e10e066810811def3763f3685c24ca10492;hb=500c7f44ab46ca6303c465586a17fa63b8488cb4;hpb=dab1cd8af9c95c119500e97920f927ae4aafc24f diff --git a/src/uci.cpp b/src/uci.cpp index d7c65e10..dbf735af 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -58,20 +58,21 @@ void uci_loop() { Position pos(StarFEN, false, 0); // The root position string cmd, token; + bool quit = false; - while (getline(cin, cmd)) + while (!quit && getline(cin, 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")