These pieces will automatically promote to piece number 7 when they
reach last rank. So in normal Chess, piece 7 should be programmed as Queen.
-Castling currently can be done only with a piece number 6 in the corner,
-so in normal Chess you should program piece 6 as Rook. Any royal piece
-can in principle castle. (Subject to the normal restrictions on castling,
-i.e. not passing through check etc.) If you don't want that, remove the
-castling moves from the King desription. If the castling initiator does
-not start in a central file, the results are currently undefined.\r
+Castling can be done only with the original corner piece as specified
+by line 2 and 3. Any royal piece can in principle castle. (Subject to
+the normal restrictions on castling, i.e. not passing through check etc.)
+If you don't want that, remove the castling moves from the King description.
+If the castling initiator does not start in a central file, the results are
+currently undefined.\r
Most variant definitions can be seen at the end of this file.
Other lines in this file (i.e. those not recognized as belonging to a
s=t;\r
if(flag&15^4|u&32|| /* no double or moved before*/\r
p>2&& /* no P & no lateral K move,*/\r
- (b[G=r<0?x&~15:BW-1|x&112]-k-6 /* no virgin R in corner G, */\r
+ ((b[G=r<0?x&~15:BW-1|x&112]^32)<33 /* no virgin R in corner G, */\r
||b[G^1]|b[G^2]|b[FF=r<0?G+3:G-2]) /* no 2 empty sq. next to R */\r
)t+=flag&4; /* fake capt. for nonsliding*/\r
else F=y; /* enable e.p. */\r
else b[m]=(m&0x70)==0x10?18:50,\r
Q+=w[2];\r
break;\r
- case 3: // can castle, normally King\r
- b[m]=3+color+32;\r
- if(m==BW>>1 && color==BLACK ||\r
- m==0x70+(BW>>1) && color==WHITE)\r
- b[m] -= 32;\r
- break;\r
- case 6: // can castle, normally Rook\r
- b[m]=6+color+32;\r
- if((m==0x00 || m==BW-1 ) && color==BLACK ||\r
- (m==0x70 || m==0x6F+BW) && color==WHITE)\r
- b[m] -= 32;\r
- Q+=w[6]; R+=w[6]/FAC;\r
- break;\r
default:\r
- b[m]=p+color;\r
- Q+=w[p]; R+=w[p]/FAC;\r
- case 0: // undefined piece, ignore\r
+ b[m]=p+color+32; // assume non-virgin\r
+ if(w[p]<0) { // Royal piece on original square: virgin
+ if(color==BLACK && m<0x10 && p==oo[m+16] ||\r
+ color==WHITE && m>0x6F && p==oo[m-0x70]) b[m] -= 32;
+ } else { Q+=w[p]; R+=w[p]/FAC; }
+ if((m==0x00 || m==BW-1 ) && color==BLACK && p==oo[m+16] ||\r
+ (m==0x70 || m==0x6F+BW) && color==WHITE && p==oo[m-0x70])\r
+ b[m] &= ~32; // corner piece as in original setup: virgin\r
+ case 0: // undefined piece, ignore\r
break;\r
}\r
pl[BLACK+WHITE-color]++;\r