int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, inex, on[500];\r
char currMove[20], moveMap[500][10], /* for analyze mode */ canPonder[20], threadOpt[20];\r
char board[100]; // XQ board for UCCI\r
-char *nameWord = "name ", *valueWord = "value ", *wTime = "w", *bTime = "b", *wInc = "winc", *bInc = "binc"; // keywords that differ in UCCI\r
+char *nameWord = "name ", *valueWord = "value ", *wTime = "w", *bTime = "b", *wInc = "winc", *bInc = "binc", newGame; // keywords that differ in UCCI\r
int unit = 1;\r
\r
FILE *toE, *fromE, *fromF;\r
if(!(p = strstr(line+6, " name "))) p = line+1; sscanf(p+6, "%[^\n]", name); // 'name' is omitted in UCCI\r
if(!strcmp(name, "Threads")) { strcpy(threadOpt, name); continue; }\r
if(!strcmp(name, "Ponder") || !strcmp(name, "USI_Ponder")) { strcpy(canPonder, name); continue; }\r
- if(!strcmp(name, "Hash") || !strcmp(name, "USI_Hash")) {\r
+ if(!strcmp(name, "Hash") || !strcmp(name, "USI_Hash") || !strcmp(name, "hashsize")) {\r
memory = oldMem = atoi(val); hasHash = 1; \r
strcpy(hashOpt, name);\r
continue;\r
}\r
+ if(!strcmp(name, "newgame") && !strcmp(type, "button")) { newGame++; continue; }\r
// pass on engine-defined option as WB option feature\r
if(!strcmp(type, "filename")) type[4] = 0;\r
sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf);\r
if(memory != oldMem && hasHash) fprintf(toE, "setoption name %s %s%d\n", hashOpt, valueWord, memory);\r
oldMem = memory;\r
// we can set other options here\r
+ if(sc == 'x') { if(newGame) fprintf(toE, "setoption newgame\n"); } else // optional in UCCI\r
+ fprintf(toE, "u%cinewgame\n", sc); fflush(toE);\r
pause = 1; // wait for option settings to take effect\r
fprintf(toE, "isready\n");\r
- fprintf(toE, "u%cinewgame\n", sc); fflush(toE);\r
Sync(PAUSE); // wait for readyok\r
}\r
else if(!strcmp(command, "usermove")) {\r