]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Better naming borrowed from Critter
[stockfish] / src / uci.cpp
index d7c65e10e066810811def3763f3685c24ca10492..86fe629a84f69708fd6057c9897790fbdc816063 100644 (file)
@@ -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")
@@ -90,7 +91,7 @@ void uci_loop() {
           pos.print();
 
       else if (token == "flip")
-          pos.flip();
+          pos.flip_me();
 
       else if (token == "eval")
       {