}\r
}\r
\r
+int DoCommand (char *line);\r
+char mySide;\r
+\r
void\r
GUI2Engine()\r
{\r
- char line[256], command[256], *p, *q, *r, mySide, type[99];\r
+ char line[256], command[256], *p;\r
\r
while(1) {\r
int i, difficult, think=0;\r
!strcmp(command, "force") || !strcmp(command, "result")) { EPRINT((f, "# stop\n")); fflush(toE); }\r
Sync(PAUSE); Release(); // block processing of difficult commands during thinking; send backlog left because of race\r
}\r
+ if(DoCommand(line)) goto nomove;\r
+ }\r
+}\r
+\r
+int\r
+DoCommand (char *line)\r
+{\r
+ char command[256], *p, *q, *r, type[99];\r
+ int i;\r
+\r
+ sscanf(line, "%s", command);\r
+\r
if(!strcmp(command, "new")) {\r
computer = BLACK; moveNr = 0; depth = -1; move[0][0] = 0;\r
stm = WHITE; strcpy(iniPos, "position startpos"); frc &= ~1;\r
}\r
else if(!strcmp(command, ".")) {\r
printf("stat01: %d %d %d %d 100 %s\n", statTime, statNodes, statDepth, 100-currNr, currMove);\r
- goto nomove;\r
+ return 1;\r
}\r
else if(!strcmp(command+2, "clude") && collect > 2) { // include or exclude\r
int all = !strcmp(line+8, "all"), in = command[1] == 'n';\r
inex = 1; line[strlen(line)-1] = sm = 0; // strip LF and clear sm flag\r
for(i=1; i<nr; i++) { if(!strcmp(line+8, moveMap[i]) || all) on[i] = in; sm |= on[i]+1; } // sm: 2 = enabled, 1 = disabled\r
- if(!(sm & 2)) goto nomove; // no moves enabled; continue current search\r
+ if(!(sm & 2)) return 1; // no moves enabled; continue current search\r
if(computer == ANALYZE) StopPonder(1), searching = 0; // abort old analysis\r
}\r
else if(!strcmp(command, "xboard")) ;\r
computer = NONE;\r
}\r
else if(!strcmp(command, "quit")) { EPRINT((f, "# quit\n")) fflush(toE), exit(atoi(line+4)); }\r
- }\r
+\r
+ return 0;\r
}\r
\r
int\r