#define CHECKEXT\r
#define LMR 4\r
#define LIONTRAP\r
-#define WINGS\r
+#define XWINGS\r
#define KINGSAFETY\r
#define KSHIELD\r
#define XFORTRESS\r
#define PST_BPPROM (3*BW*BH+BH)\r
#define PST_BJUMPER (4*BW*BH)\r
#define PST_ZONDIST (4*BW*BH+BH)\r
+#define PST_ADVANCE (5*BW*BH)\r
+#define PST_RETRACT (5*BW*BH+BH)\r
+#define PST_WFLYER (6*BW*BH)\r
+#define PST_BFLYER (6*BW*BH+BH)\r
+#define PST_END (7*BW*BH)\r
\r
typedef unsigned int Move;\r
\r
char distance[2*BSIZE]; // distance table\r
char promoBoard[BSIZE]; // flags to indicate promotion zones\r
char rawFire[BSIZE+2*BWMAX]; // flags to indicate squares controlled by Fire Demons\r
-signed char PST[5*BSIZE];\r
+signed char PST[7*BSIZE];\r
\r
#define board (rawBoard + 6*BHMAX + 3)\r
#define fireBoard (rawFire + BWMAX + 1)\r
for(i=0; i<BH; i++) for(j=0; j<BH; j++) board[BW*i+j] = EMPTY;\r
for(i=WHITE+2; i<=last[WHITE]; i+=2) if(p[i].pos != ABSENT) {\r
int g = p[i].promoGain;\r
+ if(i == kylin[WHITE]) p[i].promoGain = 1.25*KYLIN, p[i].value += KYLIN;\r
+// if(j > 0 && p[i].pst == PST_STEPPER) p[i].pst = PST_WPPROM; // use white pre-prom bonus\r
+ if(j > 0 && p[i].pst == PST_STEPPER && p[i].value >= 100)\r
+ p[i].pst = p[i].value <= 150 ? PST_ADVANCE : PST_NEUTRAL; // light steppers advance\r
+ if(j > 0 && p[i].bulk == 6) p[i].pst = PST_WFLYER, p[i].mobWeight = 4; // SM defends zone\r
if((j = p[i].promo) > 0 && g)\r
p[i].promoGain = (p[j].value - p[i].value - g)*1.25, p[i].value = p[j].value - g;\r
else p[i].promoGain = 0;\r
- if(i == kylin[WHITE]) p[i].promoGain = 1.25*KYLIN, p[i].value += KYLIN;\r
- if(j > 0 && p[i].pst == PST_STEPPER) p[i].pst = PST_WPPROM; // use white pre-prom bonus\r
board[p[i].pos] = i;\r
rootEval += p[i].value + PST[p[i].pst + p[i].pos];\r
promoDelta += p[i].promoGain;\r
} else p[i].promoGain = 0;\r
for(i=BLACK+2; i<=last[BLACK]; i+=2) if(p[i].pos != ABSENT) {\r
int g = p[i].promoGain;\r
+// if(j > 0 && p[i].pst == PST_STEPPER) p[i].pst = PST_BPPROM; // use black pre-prom bonus\r
+ if(j > 0 && p[i].pst == PST_STEPPER && p[i].value >= 100)\r
+ p[i].pst = p[i].value <= 150 ? PST_RETRACT : PST_NEUTRAL; // light steppers advance\r
+ if(j > 0 && p[i].pst == PST_WJUMPER) p[i].pst = PST_BJUMPER; // use black pre-prom bonus\r
+ if(j > 0 && p[i].bulk == 6) p[i].pst = PST_BFLYER, p[i].mobWeight = 4; // SM defends zone\r
if((j = p[i].promo) > 0 && g)\r
p[i].promoGain = (p[j].value - p[i].value - g)*1.25, p[i].value = p[j].value - g;\r
else p[i].promoGain = 0;\r
if(i == kylin[BLACK]) p[i].promoGain = 1.25*KYLIN, p[i].value += KYLIN;\r
- if(j > 0 && p[i].pst == PST_STEPPER) p[i].pst = PST_BPPROM; // use black pre-prom bonus\r
- if(j > 0 && p[i].pst == PST_WJUMPER) p[i].pst = PST_BJUMPER; // use black pre-prom bonus\r
board[p[i].pos] = i;\r
rootEval -= p[i].value + PST[p[i].pst + p[i].pos];\r
promoDelta -= p[i].promoGain;\r
PST[PST_WPPROM+s] = PST[PST_BPPROM+s] = PST[PST_STEPPER+s]; // as stepper, but with pre-promotion bonus W/B\r
PST[PST_BJUMPER+s] = PST[PST_WJUMPER+s]; // as jumper, but with pre-promotion bonus B\r
PST[PST_ZONDIST+s] = BW*(zone - 1 - i); // board step to enter promo zone black\r
+ PST[PST_ADVANCE+s] = PST[PST_WFLYER-s-1] = 2*(5*i+i*i) - (i >= zone)*8*(i-zone+1)*(i-zone+1)\r
+ - 50 - 10*(j==0 || j == BH-1); // advance-encouraging table\r
+ PST[PST_WFLYER +s] = PST[PST_END-s-1] = (i == zone-1)*40 + (i == zone-2)*20 - 20;\r
}\r
if(zone > 0) PST[PST_WPPROM+BW*(BH-1-zone) + j] += 10, PST[PST_BPPROM + BW*zone + j] += 10;\r
#if KYLIN\r
{\r
int i, j;\r
for(i=0; i<182; i++) {\r
- printf("%3d. %3d %3d %4d %02x %d %d %x %3d ", i, p[i].value, p[i].promo, p[i].pos, p[i].promoFlag&255, p[i].mobWeight, p[i].qval, p[i].bulk, p[i].promoGain);\r
+ printf("%3d. %3d %3d %4d %02x %d %d %x %3d %4d ", i, p[i].value, p[i].promo, p[i].pos, p[i].promoFlag&255, p[i].mobWeight, p[i].qval, p[i].bulk, p[i].promoGain, p[i].pst);\r
for(j=0; j<8; j++) printf(" %2d", p[i].range[j]);\r
if(i<2 || i>11) printf("\n"); else printf(" %02x\n", fireFlags[i-2]&255);\r
}\r