/*****************************************************************/\r
\r
#define MULTIPATH\r
-#define VERSION "4.8O"\r
+#define VERSION "4.8P"\r
\r
#include <stdio.h>\r
#include <stdlib.h>\r
K=BW;W(K--)\r
{b[K]=oo[K+16]+16;b[K+112]=oo[K];b[K+16]=18;b[K+96]=1; /* initial board setup*/\r
pl[oo[K+16]+16]++;pl[oo[K]]++;pl[18]++;pl[1]++;\r
+ if(w[oo[K+16]+16] == -1)pl[oo[K+16]+16]=1;\r
+ if(w[oo[K]] == -1)pl[oo[K]]=1;\r
L=8;W(L--)b[16*L+K+257]=(K-BW/2)*(K-BW/2)+(L-3.5)*(L-3.5); /* center-pts table */\r
} /*(in unused half b[])*/\r
Side = WHITE; Q=0; O=S;\r
\r
int LoadGame(char *name)\r
{\r
- int i, j, count=0; char c, buf[80];\r
+ int i, j, ptc, count=0; char c, buf[80], pieceToChar[80];\r
static int currentVariant;\r
FILE *f;\r
\r
if(name != NULL)\r
{ /* search for game name in definition file */\r
if(!strcmp(name, "fairy")) name = selectedFairy;\r
- while(fscanf(f, "Game: %s", buf)!=1 || strcmp(name, buf) ) {\r
+ while((ptc=fscanf(f, "Game: %s # %s", buf, pieceToChar))==0 || strcmp(name, buf) ) {\r
while((c = fgetc(f)) != EOF && c != '\n');\r
count++;\r
if(c == EOF) {\r
fclose(f);\r
sh = w[7] < 250 ? 3 : 0;\r
makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions\r
+ if(name == selectedFairy) {\r
+ printf(ptc == 1 ? "setup " : "setup (%s) ", pieceToChar); // setup board in GUI\r
+ for(i=0; i<BW; i++) printf("%c", piecename[oo[i+16]]+'`'); printf("/");\r
+ for(i=0; i<BW; i++) printf("%c", piecename[2]+'`'); printf("/");\r
+ for(i=2; i<BH-2; i++) printf("%d/", BW);\r
+ for(i=0; i<BW; i++) printf("%c", piecename[1]+'@'); printf("/");\r
+ for(i=0; i<BW; i++) printf("%c", piecename[oo[i]]+'@'); printf(" w KQkq - 0 1\n");\r
+ }\r
}\r
\r
int main(int argc, char **argv)\r
break;\r
}\r
pl[BLACK+WHITE-color]++;pl[p+color]++;\r
+ if(w[p+color] == -1)pl[p+color]=1; // fake we have one if value = -1, to thwart extinction condition\r
continue;\r
}\r
}\r