ParseMove(int stm, char *s)
{
char prom = 0, f, f2, piece;
- int m, r, r2, i, from;
+ int m=0, r, r2, i, from;
if(sscanf(s, "%c@%c%d", &piece, &f, &r) == 3) { // drop
f -= 'a', r--;
m = 22*r + f;
for(i=0; pieces[i]; i++) if(pieces[i] == piece) break;
m += handSlot[COLOR - stm + (i & 15)] << 8; // force type to unpromoted before taking from hand
if(i > 15) m += 11;
- } else {
- sscanf(s, "%c%d%c%d%c", &f2, &r2, &f, &r, &prom);
+ } else if(sscanf(s, "%c%d%c%d%c", &f2, &r2, &f, &r, &prom) >= 4) {
f -= 'a'; f2 -= 'a'; r--, r2--;
m = 22*r + f + ((from = 22*r2 + f2) << 8);
if(prom == '\n') prom = 0;
printf("feature option=\"Resign -check 0\"\n"); // example of an engine-defined option
printf("feature option=\"Contempt -spin 0 -200 200\"\n"); // and another one
printf("feature option=\"Multi-PV margin -spin 0 0 10000\"\n");
+ printf("feature option=\"Exclude move: -string \"\n");
printf("feature done=1\n");
return 1;
}
if(!strcmp(command, "option")) { // engine-defined options that must abort search
if(sscanf(inBuf+7, "Multi-PV margin=%d", &margin) == 1) return 1;
+ if(sscanf(inBuf+7, "Exclude move:=%s", command)) { int i = (*command == '!'); moveMap[ParseMove(stm, command+i)] = !i; return 1; }
return 1;
}
if(!strcmp(command, "sd")) { sscanf(inBuf+2, "%d", &maxDepth); return 1; }