{ 6, 6, 6, 2, "judkinshogi\n", shogiIDs, judkinFEN, shogiDirs, shogiProms, shogiCodes, judkinValues },
{ 9, 9, 7, 3, "shogi\n", shogiIDs, shogiFEN, shogiDirs, shogiProms, shogiCodes, shogiValues },
{ 11, 11, 16, 3, "crazywa\n", waIDs, waFEN, waDirs, waProms, shogiCodes, waValues },
+ { 11, 11, 16, 3, "11x17+16_chu\n",waIDs, waFEN, waDirs, waProms, shogiCodes, waValues },
{ 7, 7, 6, 2, "torishogi\n", toriIDs, toriFEN, toriDirs, toriProms, toriCodes, toriValues },
};
for(f=0,p=pstType[v]; *p; p++,f++) if(*p == ' ') f = 15; else PST[BLACK+f] = (PST[WHITE+f] = pstData + 22*11*(*p - '0')) + 11*(*p > '2');
InitCaptureCodes(variants[v].codes);
- pinCodes = (v == 5 ? 0xFF2C : 0xFF1F); // rays along which pinning ispossible
+ pinCodes = (v == 6 ? 0xFF2C : 0xFF1F); // rays along which pinning is possible
}
void
i = zoneTab[x] & Z_LAST; // Pawn not on first & last rank (OK for zh)
if(perpLoses) { // but it is Shogi!
if(!(zoneTab[x] & stm)) i = 0; // outside zone, so dropping is always allowed
- else if(perpLoses < 5) { // Shogi variant with Lance
+ else if(perpLoses < 6) { // Shogi variant with Lance
i *= 2; // no Pawn, then also no Lance!
last += 1 - (zoneTab[x] & (Z_2ND & ~COLOR)) + (perpLoses & 4) >> 3; // on last 2 ranks trim off Knight (not in Wa)
}
for(i=moveNr+ply-2; i>=d; i-=2) if(checkHist[i+1] == CK_NONE) break;
if(i < d) score = INF-1; // we are suffering a perpetual, so lose
else if(perpLoses == 1) score = (stm == WHITE ? -INF : INF-1); // mini-Shogi, sente loses
- else if(perpLoses == 5) score = -INF; // Tori Shogi, repeating loses
+ else if(perpLoses == 6) score = -INF; // Tori Shogi, repeating loses
}
}
int pstEval, rights, stm = WHITE, i, p, sqr = 22*(nrRanks-1); // upper-left corner
ClearBoard();
if(!fen) fen = startFEN; else strcpy(startFEN, fen); // remember start position, or use remembered one if not given
+ if(strchr(fen, '*') && strlen(fen) > 30) fen += 18; // Alien-Edition Wa implementation; strip off leading 11/11/***********/
rights = 15; pstEval = 0; // no castling rights, balance score
hashKey = pawnKey = 0; // clear hash keys
while(*fen) { // parse board-field of FEN
if(*fen == ' ' || *fen == '[') break;
if(*fen == '/') sqr = 22*(sqr/22) - 22; else // skip to (start of) next rank
+ if(*fen == '*') fen++; else // ignore dark squares
if(*fen <= '9' && *fen >= '0') {
int n = atoi(fen); sqr += n; fen += (n > 9); // skip given number of squares (and second digit of 10 or 11)
} else {
if(!strcmp(command, "protover")){
printf("feature ping=1 setboard=1 colors=0 usermove=1 memory=1 debug=1 reuse=0 sigint=0 sigterm=0 myname=\"CrazyWa " VERSION "\"\n");
printf("feature variants=\"crazyhouse,shogi,minishogi,judkinshogi,torishogi,euroshogi,crazywa,"
- "5x5+5_shogi,6x6+6_shogi,7x7+6_shogi,11x11+16_shogi,8x8+6_crazyhouse,8x8+7_crazyhouse\"\n");
+ "5x5+5_shogi,6x6+6_shogi,7x7+6_shogi,11x17+16_chu\"\n");
printf("feature option=\"Resign -check 0\"\n"); // example of an engine-defined option
printf("feature option=\"Contempt -spin 0 -200 200\"\n"); // and another one
printf("feature done=1\n");