\r
#define VERSION "0.16 k+ky"\r
\r
-#define PATH level==0 /*|| path[0] == 0x3490a && (level==1 || path[1] == 0x285b3 && (level == 2 || path[2] == 0x8710f && (level == 3 /*|| path[3] == 0x3e865 && (level == 4 || path[4] == 0x4b865 && (level == 5)))))*/\r
-//define PATH 0\r
+//define PATH level==0 /*|| path[0] == 0x3490a && (level==1 || path[1] == 0x285b3 && (level == 2 || path[2] == 0x8710f && (level == 3 /*|| path[3] == 0x3e865 && (level == 4 || path[4] == 0x4b865 && (level == 5)))))*/\r
+#define PATH 0\r
\r
#define HASH\r
#define KILLERS\r
#define BSIZE BWMAX*BHMAX\r
#define ZONE zone\r
\r
-#define ONE (currentVariant == V_SHO || currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_MAKRUK)\r
+#define ONE (currentVariant == V_SHO || currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_MAKRUK || currentVariant == V_LION)\r
\r
#define BLACK 0\r
#define WHITE 1\r
{ NULL } // sentinel\r
};\r
\r
+PieceDesc lionPieces[] = {\r
+ {"LN","", LVAL, { L,L,L,L,L,L,L,L } },\r
+ {"Q", "", 600, { X,X,X,X,X,X,X,X } },\r
+ {"R", "", 300, { X,0,X,0,X,0,X,0 } },\r
+ {"K", "", 280, { 1,1,1,1,1,1,1,1 } },\r
+ {"B", "", 190, { 0,X,0,X,0,X,0,X } },\r
+ {"N", "", 180, { N,N,N,N,N,N,N,N } },\r
+ {"P", "Q", 50, { M,C,0,0,0,0,0,C } },\r
+ { NULL } // sentinel\r
+};\r
+\r
PieceDesc shatranjPieces[] = {\r
{"FK", "", 150, { 0,1,0,1,0,1,0,1 } },\r
{"R", "", 500, { X,0,X,0,X,0,X,0 } },\r
":ss:vsb:dh:dk:wb:fi:fe:lh:fi:wb:dk:dhb:vs:ss/:rv.:cs:cs.:bt:ph:fk:ln:kn:bt.:cs:cs.:rv/ln:flicsg:dekgsci:flnl";\r
char shoArray[] = "LNSGKGSNL/.B..:DE..R./PPPPPPPPP/........./........./........./ppppppppp/.r..:de..b./lnsgkgsnl";\r
char chessArray[] = "RNBQKBNR/PPPPPPPP/......../......../......../......../pppppppp/rnbqkbnr";\r
+char lionArray[] = "R:LNBQKBNR/PPPPPPPP/......../......../......../......../pppppppp/r:lnbqkbnr";\r
char shatArray[]= "RNBK:FKBNR/PPPPPPPP/......../......../......../......../pppppppp/rnbk:fkbnr";\r
char thaiArray[]= "RNSK:SMSNR/......../PPPPPPPP/......../......../pppppppp/......../rnsk:smsnr";\r
\r
char *array; // initial position\r
} VariantDesc;\r
\r
-typedef enum { V_CHESS, V_SHO, V_CHU, V_DAI, V_TENJIKU, V_DADA, V_MAKA, V_TAI, V_KYOKU, V_SHATRANJ, V_MAKRUK } Variant;\r
+typedef enum { V_CHESS, V_SHO, V_CHU, V_DAI, V_TENJIKU, V_DADA, V_MAKA, V_TAI, V_KYOKU, V_SHATRANJ, V_MAKRUK, V_LION, V_NUMBER } Variant;\r
\r
VariantDesc variants[] = {\r
{ 16, 8, 8, 1, V_CHESS, "normal", chessArray }, // FIDE\r
{ 32, 16, 16, 5, V_TENJIKU, "tenjiku", tenArray }, // Tenjiku\r
{ 16, 8, 8, 1, V_SHATRANJ,"shatranj",shatArray}, // Shatranj\r
{ 16, 8, 8, 3, V_MAKRUK, "makruk", thaiArray}, // Makruk\r
+ { 16, 8, 8, 1, V_LION, "lion", lionArray}, // Mighty Lion\r
\r
// { 0, 0, 0, 0, 0 }, // sentinel\r
{ 34, 17, 17, 0, V_DADA, "dada", chuArray }, // Dai Dai\r
return ListLookUp(name, shatranjPieces);\r
case V_MAKRUK: // Makruk\r
return ListLookUp(name, makrukPieces);\r
+ case V_LION: // Mighty Lion\r
+ return ListLookUp(name, lionPieces);\r
}\r
return NULL;\r
}\r
zone = variants[var].zoneDepth;\r
array = variants[var].array;\r
bsize = bWidth*bHeight;\r
- chuFlag = (currentVariant == V_CHU);\r
+ chuFlag = (currentVariant == V_CHU || currentVariant == V_LION);\r
tenFlag = (currentVariant == V_TENJIKU);\r
- chessFlag = (currentVariant == V_CHESS);\r
- repDraws = (currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_MAKRUK);\r
+ chessFlag = (currentVariant == V_CHESS || currentVariant == V_LION);\r
+ repDraws = (currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_MAKRUK || currentVariant == V_LION);\r
ll = 0; lr = bHeight - 1; ul = (bHeight - 1)*bWidth; ur = ul + bHeight - 1;\r
\r
for(i= -1; i<9; i++) { // board steps in linear coordinates\r
sup2 = sup1; sup1 = sup0;\r
}\r
\r
-char fenNames[] = "RV....DKDEFL..DHGB......SMLNKN..FK....BT..VM..PH...."; // pairs of char\r
+char fenNames[] = "RV....DKDEFL..DHGB......SMLNKN..FK....BT..VM..PH..LN"; // pairs of char\r
char fenPromo[] = "WLDHSMSECPB R HFDE....WHFB..LNG ..DKVMFS..FO..FK...."; // pairs of char\r
\r
char *\r
if(n=atoi(fen)) fen++; // digits read\r
if(n > 9) fen++; // double digit\r
while(n-- > 0) *p++ = '.'; // expand to empty squares\r
+ if(currentVariant == V_LION && (*fen == 'L' || *fen == 'l')) *fen += 'Z' - 'L'; // L in Mighty-Lion Chess changed in Z for Lion\r
if(isalpha(*fen)) {\r
char *table = fenNames;\r
n = *fen > 'Z' ? 'a' - 'A' : 0;\r
- if((currentVariant == V_CHESS || currentVariant == V_SHATRANJ ||\r
+ if((currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_LION ||\r
currentVariant == V_MAKRUK || currentVariant == V_SHO) && *fen - n == 'N' // In Chess N is Knight, not Lion\r
|| table[2* (*fen - 'A' - n)] == '.') *p++ = *fen; else {\r
*p++ = ':';\r
}\r
if(!strcmp(command, "protover")){\r
printf("feature ping=1 setboard=1 colors=0 usermove=1 memory=1 debug=1 sigint=0 sigterm=0\n");\r
- printf("feature variants=\"normal,shatranj,makruk,chu,dai,tenjiku,12x12+0_fairy,9x9+0_shogi\"\n");\r
+ printf("feature variants=\"normal,shatranj,makruk,chu,dai,tenjiku,12x12+0_fairy,9x9+0_shogi,lion\"\n");\r
printf("feature myname=\"HaChu " VERSION "\" highlight=1\n");\r
printf("feature option=\"Full analysis PV -check 1\"\n"); // example of an engine-defined option\r
printf("feature option=\"Allow repeats -check 0\"\n");\r
continue;\r
}\r
if(!strcmp(command, "variant")) {\r
- for(i=0; i<7; i++) {\r
+ for(i=0; i<8; i++) {\r
sscanf(inBuf+8, "%s", command);\r
if(!strcmp(variants[i].name, command)) {\r
Init(curVarNr = i); stm = Setup2(NULL); break;\r