// promotions by pieces with Lion power stepping in & out the zone in same turn\r
// promotion on capture\r
\r
-#define VERSION "0.6beta"\r
+#define VERSION "0.7beta"\r
\r
#define PATH level==0 || path[0] == 0xc4028 && (level==1 /*|| path[1] == 0x75967 && (level == 2 || path[2] == 0x3400b && (level == 3))*/)\r
//define PATH 0\r
SetUp(char *array, int var)\r
{\r
int i, j, n, m, nr, color;\r
- char c, *q, name[3];\r
+ char c, *q, name[3], prince = 0;\r
PieceDesc *p1, *p2;\r
last[WHITE] = 1; last[BLACK] = 0;\r
- if(var == V_CHESS || var == V_SHATRANJ || var == V_MAKRUK) // add dummy Crown Princes\r
- p[AddPiece(WHITE, LookUp("CP", V_CHU))].pos = p[AddPiece(BLACK, LookUp("CP", V_CHU))].pos = ABSENT;\r
for(i=0; ; i++) {\r
//printf("next rank: %s\n", array);\r
for(j = BW*i; ; j++) {\r
name[0] += 'A' - 'a';\r
if(name[1]) name[1] += 'A' - 'a';\r
} else color = WHITE;\r
+ if(!strcmp(name, "CP")) prince |= color+1; // remember if we added Crown Prince\r
p1 = LookUp(name, var);\r
if(!p1) printf("tellusererror Unknown piece '%s' in setup\n", name), exit(-1);\r
if(pflag && p1->promoted) p1 = LookUp(p1->promoted, var); // use promoted piece instead\r
n = AddPiece(color, p1);\r
p[n].pos = j;\r
if(p1->promoted[0] && !pflag) {\r
+ if(!strcmp(p1->promoted, "CP")) prince |= color+1; // remember if we added Crown Prince\r
p2 = LookUp(p1->promoted, var);\r
m = AddPiece(color, p2);\r
if(m <= n) n += 2;\r
}\r
}\r
eos:\r
+ // add dummy Crown Princes if not yet added\r
+ if(!(prince & WHITE+1)) p[AddPiece(WHITE, LookUp("CP", V_CHU))].pos = ABSENT;\r
+ if(!(prince & BLACK+1)) p[AddPiece(BLACK, LookUp("CP", V_CHU))].pos = ABSENT;\r
for(i=0; i<8; i++) fireFlags[i] = 0;\r
for(i=2, n=1; i<10; i++) if(p[i].value == 10*FVAL) {\r
int x = p[i].pos; // mark all burn zones\r