} UndoInfo;\r
\r
char *array, fenArray[4000], startPos[4000], *reason, checkStack[300];\r
-int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws, stalemate, tsume, pvCuts, allowRep, entryProm;\r
+int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws, stalemate, tsume, pvCuts, allowRep, entryProm, pVal;\r
int stm, xstm, hashKeyH=1, hashKeyL=1, framePtr, msp, nonCapts, rootEval, filling, promoDelta;\r
int retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore;\r
int ll, lr, ul, ur; // corner squares\r
Init (int var)\r
{\r
int i, j, k;\r
+ PieceDesc *pawn;\r
\r
currentVariant = variants[var].varNr;\r
bWidth = variants[var].boardWidth;\r
stalemate = (currentVariant == V_CHESS || currentVariant == V_MAKRUK || currentVariant == V_LION);\r
repDraws = (stalemate || currentVariant == V_SHATRANJ);\r
ll = 0; lr = bHeight - 1; ul = (bHeight - 1)*bWidth; ur = ul + bHeight - 1;\r
+ pawn = LookUp("P", currentVariant); pVal = pawn ? pawn->value : 0; // get Pawn value\r
\r
for(i= -1; i<9; i++) { // board steps in linear coordinates\r
kStep[i] = STEP(direction[i&7].x, direction[i&7].y); // King\r
phase = 4; // out of victims: all captures generated\r
if(chessFlag && promoSuppress != ABSENT) { // e.p. rights. Create e.p. captures as Lion moves\r
int n = board[promoSuppress-1], old = msp; // a-side neighbor of pushed pawn\r
- if( n != EMPTY && (n&TYPE) == stm && p[n].value == 80 ) NewCapture(promoSuppress-1, SPECIAL + 20 - 4*stm, 0);\r
+ if( n != EMPTY && (n&TYPE) == stm && p[n].value == pVal ) NewCapture(promoSuppress-1, SPECIAL + 20 - 4*stm, 0);\r
n = board[promoSuppress+1]; // h-side neighbor of pushed pawn\r
- if( n != EMPTY && (n&TYPE) == stm && p[n].value == 80 ) NewCapture(promoSuppress+1, SPECIAL + 52 - 4*stm, 0);\r
+ if( n != EMPTY && (n&TYPE) == stm && p[n].value == pVal ) NewCapture(promoSuppress+1, SPECIAL + 52 - 4*stm, 0);\r
if(msp != old) goto extractMove; // one or more e.p. capture were generated\r
}\r
case 4: // dubious captures\r
for(j=0; j<8; j++) if(e + kStep[j] == t) break;\r
if(j >= 8) return INVALID; // this rejects Lion Dog 1+2 moves!\r
t2 = SPECIAL + 8*i + j;\r
- } else if(chessFlag && board[f] != EMPTY && p[board[f]].value == 80 && board[t] == EMPTY) { // Pawn to empty, could be e.p.\r
+ } else if(chessFlag && board[f] != EMPTY && p[board[f]].value == pVal && board[t] == EMPTY) { // Pawn to empty, could be e.p.\r
if(t == f + BW + 1) t2 = SPECIAL + 16; else\r
if(t == f + BW - 1) t2 = SPECIAL + 48; else\r
if(t == f - BW + 1) t2 = SPECIAL + 20; else\r
PrintResult(stm, score);\r
} else {\r
MOVE f, pMove = move;\r
- if((move & SQUARE) >= SPECIAL && p[board[f = move>>SQLEN & SQUARE]].value == 80) { // e.p. capture\r
+ if((move & SQUARE) >= SPECIAL && p[board[f = move>>SQLEN & SQUARE]].value == pVal) { // e.p. capture\r
pMove = move & ~SQUARE | f + toList[(move & SQUARE) - SPECIAL]; // print as a single move\r
}\r
stm = MakeMove2(stm, move); // assumes MakeMove returns new side to move\r