int Threshold = 800;\r
int Score;\r
int makruk;\r
-int prom, pm, gating;\r
+int prom, pm, gating, succession;\r
char piecename[32], piecetype[32], blacktype[32];\r
char selectedFairy[80];\r
char *inifile = INI_FILE;\r
if(cnt==-I+1) {\r
if (s == WHITE)\r
printf("0-1 {Black mates}\n");\r
- else\r
+ else {\r
+ if(succession) { // suppress loss claim if black might be able to replace its King by promotion\r
+ for(j=0;j<BW;j++)if((b[j+96]&31)==18)return 0;\r
+ }\r
printf("1-0 {White mates}\n");\r
+ }\r
return 3;\r
}\r
if(Fifty >=100) {\r
if(fscanf(f, "version 4.8(%c)", &c)!=1 || c != 'w')\r
{ printf("telluser incompatible fmax.ini file\n"); exit(0); }\r
\r
- gating = 0;\r
+ gating = succession = 0;\r
if(name != NULL)\r
{ /* search for game name in definition file */\r
if(!strcmp(name, "makruk") && Cambodian) name = "cambodian"; else\r
{ od[++i]=j; centr[i] = c>='a';\r
blacktype[c&31]=i; piecename[i]=c&31;\r
if(piecetype[c&31]==0) piecetype[c&31]=i; // only first\r
+ succession |= w[i] < -4; // expendable royalty; assume we can promote to it\r
}\r
j++; o[j]=0;\r
/* printf("# c='%c' i=%d od[i]=%d j=%d (%3d,%8x)\n",c?c:' ',i,od[i],j,o[j-1],of[j-1]); /**/\r
GT = (Side == WHITE ? piecetype : blacktype)[line[4]&31];\r
if(GT) PromPiece = (Side == WHITE ? 7 : 7+pm) - GT, GT |= 32 + Side;\r
{char *c=line; K=c[0]-16*c[1]+799;L=c[2]-16*c[3]+799; }\r
+ if(w[GT&15] == -1) L = S; // spoil move for promotion to King\r
if (m & line[1] != '@')\r
/* doesn't have move syntax */\r
printf("Error (unknown command): %s\n", command);\r