int mps, tc, inc, sTime, depth, myTime, hisTime, stm, computer = NONE, memory, oldMem=0, cores, moveNr, lastDepth, lastScore, startTime, debug;\r
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
int unit = 1;\r
\r
FILE *toE, *fromE, *fromF;\r
}\r
\r
void\r
+FromFEN(char *fen)\r
+{ int i=0;\r
+ while(*fen) {\r
+ char c = *fen++;\r
+ if(c >= 'A') board[i++] = c; else\r
+ if(c == '/') i++; else\r
+ if(c == ' ') break; else\r
+ while(c-- > '0' && i < 99) board[i++] = 0;\r
+ if(i >= 99) break;\r
+ }\r
+}\r
+\r
+char *\r
+ToFEN(int stm)\r
+{\r
+ int i, n=0; static char fen[200]; char *p = fen;\r
+ for(i=0; i<99; i++) {\r
+ char c = board[i];\r
+ if(c >= 'A') { if(n) *p++ = '0' + n; n = 0; *p++ = c; } else n ++;\r
+ if(i%10 == 8) { if(n) *p++ = '0' + n; n = -1; *p++ = '/'; }\r
+ }\r
+ sprintf(p-1, " %c - - 0 1", stm);\r
+ return fen;\r
+}\r
+\r
+int\r
+Sqr(char *m, int j)\r
+{\r
+ int n = m[j] - 'a' + 10*('9' - m[j+1]);\r
+ if(n < 0) n = 0; else if(n > 99) n = 99; return n;\r
+}\r
+\r
+int\r
+Play(int nr)\r
+{\r
+ int i, last = -1;\r
+ FromFEN(iniPos + 4); // in XQ iniPos always has just "fen " prefix\r
+ for(i=0; i<nr; i++) {\r
+ int from=Sqr(move[i], 0), to=Sqr(move[i], 2);\r
+ if(board[to]) last = i;\r
+ board[to] = board[from]; board[from] = 0;\r
+ }\r
+ return last;\r
+}\r
+\r
+void\r
StartSearch(char *ponder)\r
{ // send the 'go' command to engine. Suffix by ponder.\r
int x = (ponder[0] != 0);\r