#define D -4 /* linear double move */\r
#define T -5 /* linear triple move */\r
#define L -6 /* true Lion move */\r
-#define F -7 /* Lion + 3-step */\r
-#define S -8 /* Lion + range */\r
-#define H -9 /* hook move */\r
-#define C -10 /* capture only */\r
-#define M -11 /* non-capture only */\r
+#define W -7 /* Werewolf move */\r
+#define F -8 /* Lion + 3-step */\r
+#define S -9 /* Lion + range */\r
+#define H -10 /* hook move */\r
+#define C -11 /* capture only */\r
+#define M -12 /* non-capture only */\r
\r
#define LVAL 1000 /* piece value of Lion. Used in chu for recognizing it to implement Lion-trade rules */\r
#define FVAL 5000 /* piece value of Fire Demon. Used in code for recognizing moves with it and do burns */\r
\r
PieceDesc chuPieces[] = {\r
- {"LN", "", LVAL, { T,T,T,T,T,T,T,T }, 4 }, // lion\r
+ {"LN", "", LVAL, { W,W,W,W,W,W,W,W }, 4 }, // lion\r
+// {"LN", "", LVAL, { T,T,T,T,T,T,T,T }, 4 }, // lion\r
// {"LN", "", LVAL, { L,L,L,L,L,L,L,L }, 4 }, // lion\r
{"FK", "", 600, { X,X,X,X,X,X,X,X }, 4 }, // free king\r
{"SE", "", 550, { X,D,X,X,X,X,X,D }, 4 }, // soaring eagle\r
if(r >= S) { // in any case, do a jump of 2\r
int occup = NewNonCapture(x, x + 2*v, pFlag);\r
if(r < I) { // Lion power, also single step\r
- if(!NewNonCapture(x, x + v, pFlag)) nullMove = x; else occup = 1;\r
+ if(!NewNonCapture(x, x + v, pFlag)) nullMove = x*(r != W); else occup = 1;\r
if(r <= L) { // true Lion, also Knight jump\r
if(!occup & r < L) for(y=x+2*v; !NewNonCapture(x, y+=v, pFlag) && r == S; ); // BS and FF moves\r
v = nStep[j];\r
- NewNonCapture(x, x + v, pFlag);\r
+ if(r != W) NewNonCapture(x, x + v, pFlag);\r
} else if(r == T) NewNonCapture(x, x+3*v, pFlag); // Lion Dog, also triple step\r
} else if(r == I) NewNonCapture(x, x + v, pFlag); // also do step\r
} else\r
if(r <= L) { // true Lion, also Knight jump\r
if(r < L) { // Lion plus (limited) range\r
int y = x, n = 0;\r
- r = (r == S ? 36 : 3);\r
- while(n++ <= r) {\r
+ int rg = (r == S ? 36 : 3);\r
+ while(n++ < rg) {\r
if(board[y+=v] == EDGE) break;\r
if(board[y] != EMPTY) {\r
if(n > 2) map[2*y + start] += one[j]; // outside Lion range\r
}\r
}\r
v = nStep[j];\r
- if(board[x + v] != EMPTY && board[x + v] != EDGE)\r
+ if(board[x + v] != EMPTY && board[x + v] != EDGE && r != W)\r
map[2*(x + v) + start] += one[8];\r
}\r
}\r
NewCapture(x, sqr + victimValue - SORTKEY(attacker), p[attacker].promoFlag);\r
att -= one[i];\r
break;\r
+ case W: // jump + locust jump + 3-slide (Werewolf)\r
+ if(d > 2) break;\r
+ NewCapture(x, sqr + victimValue - SORTKEY(attacker), p[attacker].promoFlag);\r
+ att -= one[i];\r
+ if(d == 2) { // check if we can take intermediate with it\r
+ if((board[x-v] & TYPE) == xstm && board[x-v] > board[sqr])\r
+ NewCapture(x, SPECIAL + 9*i + victimValue - SORTKEY(attacker), p[attacker].promoFlag); // e.p.\r
+ } else { // d=1; can move on to second\r
+ if(board[sqr-v] == EMPTY || (board[sqr-v] & TYPE) == xstm && board[sqr-v] > board[sqr])\r
+ NewCapture(x, SPECIAL + 9*i + victimValue - SORTKEY(attacker), p[attacker].promoFlag); // hit and run\r
+ }\r
+ break;\r
case C: // FIDE Pawn\r
if(d != 1) break;\r
NewCapture(x, sqr + victimValue - SORTKEY(attacker), p[attacker].promoFlag);\r
if(chuFlag && p[undoInfo.victim].value == LVAL && p[undoInfo.piece].value != LVAL) sup2 |= PROMOTE;\r
rootEval = -rootEval - undoInfo.booty;\r
for(i=0; i<200; i++) repStack[i] = repStack[i+1], checkStack[i] = checkStack[i+1];\r
+\r
+\r
repStack[199] = hashKeyH, checkStack[199] = inCheck;\r
printf("# makemove %08x %c%d %c%d\n", move, sup1%BW+'a', sup1/BW, sup2%BW+'a', sup2/BW);\r
return stm ^ WHITE;\r