char fireMask;\r
} UndoInfo;\r
\r
-char *array, fenArray[4000], startPos[4000], *reason, checkStack[300];\r
+char *array, *IDs, fenArray[4000], startPos[4000], *reason, checkStack[300];\r
int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws, stalemate;\r
int tsume, pvCuts, allowRep, entryProm, okazaki, pVal;\r
int stm, xstm, hashKeyH=1, hashKeyL=1, framePtr, msp, nonCapts, rootEval, filling, promoDelta;\r
{"HH", "", 220, { N,0,0,N,N,0,0,N }, 1 }, // Heavenly Horse\r
{"VW", "PO", 220, { 1,1,1,0,1,0,1,1 }, 2 }, // Violent Wolf (G)\r
{"VS", "RB", 200, { 1,1,0,1,0,1,0,1 }, 2 }, // Violent Stag (S)\r
- {"FG", "SW" 190, { 1,1,0,0,1,0,0,1 }, 2 }, // Flying Goose (C)\r
+ {"FG", "SW", 190, { 1,1,0,0,1,0,0,1 }, 2 }, // Flying Goose (C)\r
{"CM", "VS", 175, { 1,1,0,0,1,0,0,1 }, 2 }, // Climbing Monkey (C)\r
{"LH", "HH", 170, { X,0,0,0,2,0,0,0 }, 1 }, // Liberated Horse\r
{"BD", "VW", 150, { 0,1,1,0,1,0,1,1 }, 2 }, // Blind Dog\r
{"FC", "RF", 130, { 0,1,1,0,0,0,1,1 }, 2 }, // Flying Cock\r
{"SO", "CE", 115, { 1,0,0,1,0,1,0,0 }, 2 }, // Swooping Owl\r
{"SC", "FF", 105, { 1,0,0,1,0,1,0,0 }, 2 }, // Strutting Crow\r
- {"P", "GB", 80, { 1,0,0,0,0,0,0,0 }, 2 }, // Sparrow Pawn (P)\r
+ {"P", "VW", 80, { 1,0,0,0,0,0,0,0 }, 2 }, // Sparrow Pawn (P)\r
{ NULL } // sentinel\r
};\r
\r
{ NULL } // sentinel\r
};\r
\r
-char makaIDs[] = "RVB C DKDEFLG DHI ..K L SMN KYP FKR S BT..VMEWPH...." // L\r
- "ABBBCS FDGB DVDS OM OR STT VOWR " // L'\r
- " CP HM LN LD "; // L!\r
PieceDesc makaPieces[] = {\r
{"DV", "TK", 10, { 0,1,0,1,0,0,1,1 } }, // Deva\r
{"DS", "BS", 10, { 0,1,1,0,0,1,0,1 } }, // Dark Spirit\r
};\r
\r
PieceDesc shatranjPieces[] = {\r
- {"F", "", 150, { 0,1,0,1,0,1,0,1 } },\r
+ {"Q", "", 150, { 0,1,0,1,0,1,0,1 } },\r
{"R", "", 500, { X,0,X,0,X,0,X,0 } },\r
- {"E", "", 90, { 0,J,0,J,0,J,0,J } },\r
+ {"B", "", 90, { 0,J,0,J,0,J,0,J } },\r
{"N", "", 300, { N,N,N,N,N,N,N,N } },\r
{"K", "", 280, { 1,1,1,1,1,1,1,1 } },\r
- {"P", "F", 80, { M,C,0,0,0,0,0,C } },\r
+ {"P", "Q", 80, { M,C,0,0,0,0,0,C } },\r
{ NULL } // sentinel\r
};\r
\r
{ NULL } // sentinel\r
};\r
\r
-char chuArray[] = "l:flcsg:dekgsc:fll/:rv1b1:bt:ph:kn:bt1b1:rv/:sm:vmr:dh:dk:fk:ln:dk:dhr:vm:sm/pppppppppppp/3:gb4:gb3"\r
+char chuArray[] = "lfcsgekgscfl/a1b1txot1b1a/mvrhdqndhrvm/pppppppppppp/3i4i3"\r
"/12/12/"\r
- "3:GB4:GB3/PPPPPPPPPPPP/:SM:VMR:DH:DK:LN:FK:DK:DHR:VM:SM/:RV1B1:BT:KN:PH:BT1B1:RV/L:FLCSGK:DEGSC:FLL";\r
-char daiArray[] = "ln:sticsgkgsci:stnl/:rv1:cs1:fl1:bt:de:bt1:fl1:cs1:rv/1:vo1:ab1:ew:ph:ln:kn:ew1:ab1:vo1/r:fd:sm:vmb:dh:dk:fk:dk:dhb:vm:sm:fdr/"\r
- "ppppppppppppppp/4:gb5:gb4/15/15/15/4:GB5:GB4/PPPPPPPPPPPPPPP/"\r
- "R:FD:SM:VMB:DH:DK:FK:DK:DHB:VM:SM:FDR/1:VO1:AB1:EW:KN:LN:PH:EW1:AB1:VO1/:RV1:CS1:FL1:BT:DE:BT1:FL1:CS1:RV/LN:STICSGKGSCI:STNL";\r
-char tenArray[] = "ln:flicsg:dekgsci:flnl/:rv1:cs:cs1:bt:ph:fk:ln:kn:bt1:cs:cs1:rv/:ss:vsb:dh:dk:wb:fi:fe:lh:fi:wb:dk:dhb:vs:ss/"\r
- ":sm:vmr:hf:se:bg:rg:vg:gg:rg:bg:se:hfr:vm:sm/pppppppppppppppp/4d6d4/"\r
+ "3I4I3/PPPPPPPPPPPP/MVRHDNQDHRVM/A1B1TOXT1B1A/LFCSGKEGSCFL";\r
+char daiArray[] = "lnuicsgkgsciunl/a1c'1f1tet1f1c'1a/1x'1a'1wxl!ow1a'1x'1/rf'mvbhdqdhbvmf'r/"\r
+ "ppppppppppppppp/4p'5p'4/15/15/15/4P'5P'4/PPPPPPPPPPPPPPP/"\r
+ "RF'MVBHDQDHBVMF'R/1X'1A'1WOL!XW1A'1X'1/A1C'1F1TET1F1C'1A/LNUICSGKGSCIUNL";\r
+char tenArray[] = "lnficsgekgscifnl/a1c!c!1txql!ot1c!c!1a/s'v'bhdw!d!q!h!d!w!dhbv's'/"\r
+ "mvrf!e!b!r!v!q!r!b!e!f!rvm/pppppppppppppppp/4d6d4/"\r
"16/16/16/16/"\r
- "4D6D4/PPPPPPPPPPPPPPPP/:SM:VMR:HF:SE:BG:RG:GG:VG:RG:BG:SE:HFR:VM:SM/"\r
- ":SS:VSB:DH:DK:WB:FI:LH:FE:FI:WB:DK:DHB:VS:SS/:RV1:CS:CS1:BT:KN:LN:FK:PH:BT1:CS:CS1:RV/LN:FLICSGK:DEGSCI:FLNL";\r
-char shoArray[] = "lnsgkgsnl/1r2:de2b1/ppppppppp/9/9/9/PPPPPPPPP/1B2:DE2R1/LNSGKGSNL";\r
-char waArray[] = ":lh:cm:so:fc:vsk:vw:fg:sc:bd:oc/1:ce3:sw3:ff1/ppp:rrppp:tfppp/3p3p3"\r
- "/11/11/11/"\r
- "3P3P3/PPP:TFPPP:RRPPP/1:FF3:SW3:CE1/:OC:BD:SC:FG:VWK:VS:FC:SO:CM:LH";\r
+ "4D6D4/PPPPPPPPPPPPPPPP/MVRF!E!B!R!Q!V!R!B!E!F!RVM/"\r
+ "S'V'BHDW!D!H!Q'D!W!DHBV'S'/A1C!C!TOL!QXT1C!C!1A/LNFICSGKEGSCIFNL";\r
+char shoArray[] = "lnsgkgsnl/1r2e2b1/ppppppppp/9/9/9/PPPPPPPPP/1B2E2R1/LNSGKGSNL";\r
+char waArray[] = "hmlcvkwgudo/1e3s3f1/ppprpppxppp/3p3p3/11/11/11/3P3P3/PPPXPPPRPPP/1F3S3E1/ODUGWKVCLMH";\r
char chessArray[] = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR";\r
char lionArray[] = "rlbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RLBQKBNR";\r
-char shatArray[]= "rnekfenr/pppppppp/8/8/8/8/PPPPPPPP/RNEKFENR";\r
-char thaiArray[]= "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR";\r
-char wolfArray[]= "rnbwkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBWKBNR";\r
+char shatArray[] = "rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR";\r
+char thaiArray[] = "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR";\r
+char wolfArray[] = "rnbwkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBWKBNR";\r
\r
// translation tables for single-(dressed-)letter IDs to multi-letter names, per variant\r
// A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.\r
-char chuIDs[] = "RVB C DKDEFLG DHGB..K L SMLNKYP FKR S BT..VM..PH....";\r
-char daiIDs[] = "RVB C DKDEFLG DHI ..K L SMN KYP FKR S BTSGVMEWPH...." // L\r
+char chuIDs[] = "RVB C DKDEFLG DHGB..K L SMLNKNP FKR S BT..VM..PH....";\r
+char daiIDs[] = "RVB C DKDEFLG DHI ..K L SMN KNP FKR S BTSGVMEWPH...." // L\r
"AB CS FD GB VO " // L'\r
" LN "; // L!\r
-char tenIDs[] = "RVB C DKDEFLG DHI ..K L SMN KYP FKR S BT..VM..PH...." // L\r
- ".. ..D .. SS VS " // L'\r
- " BGCSFISEHFGGLH LN FERG VGWB "; // L!\r
-char waIDs[] = "....FCBDCEFFFGLH....K SOBM..OCP ..RRSW..SCVSVWTF....";\r
+char tenIDs[] = "RVB C DKDEFLG DHI ..K L SMN KNP FKR S BT..VM..PH...." // L\r
+ ".. ..D .. FE SS VS " // L'\r
+ " BGCSFISEHF LH LN GGRG VGWB "; // L!\r
+char waIDs[] = "....FCBDCEFFFGLH....K SOCM..OCP ..RRSW..SCVSVWTF....";\r
char chessIDs[] = "A B ....E F ........K L M N ..P Q R S ......W ......"; // covers all chess-like variants\r
-char makaIDs[] = "RVB C DKDEFLG DHI ..K L SMN KYP FKR S BTSG..EWPHT .." // L (also for Macadamia)\r
+char makaIDs[] = "RVB C DKDEFLG DHI ..K L SMN KNP FKR S BTSG..EWPHT .." // L (also for Macadamia)\r
"ABBBCSBDE FDGG DVDS LCBMCCORGB RCSD WRVODY " // L'\r
" CARD HM LN CO VMLD "; // L!\r
-char dadaIDs[] = "RVB C DKEFFLG DHI ..K L SMNKKYP FKR S ..SGVBEWPH...." // L (also for Cashew)\r
+char dadaIDs[] = "RVB C DKEFFLG DHI ..K L SMNKKNP FKR S ..SGVBEWPH...." // L (also for Cashew)\r
"ABEBCSHDEBFDPRFHLGRGOKLCOMNBORPS RCSBST W WBVO " // L'\r
"RAWB BD GOHM LN SQ WTRUVMLD "; // L!\r
\r
int boardWidth, boardFiles, boardRanks, zoneDepth, varNr; // board sizes\r
char *name; // WinBoard name\r
char *array; // initial position\r
+ char *IDs;\r
} VariantDesc;\r
\r
typedef enum { V_CHESS, V_SHO, V_CHU, V_DAI, V_DADA, V_MAKA, V_TAI, V_KYOKU, V_TENJIKU, V_SHATRANJ, V_MAKRUK, V_LION, V_WA, V_WOLF } Variant;\r
#define SAME (-1)\r
\r
VariantDesc variants[] = {\r
- { 24, 12, 12, 4, V_CHU, "chu", chuArray }, // Chu\r
- { 16, 8, 8, 1, V_CHESS, "nocastle", chessArray }, // FIDE\r
- { 18, 9, 9, 3, V_SHO, "9x9+0_shogi", shoArray }, // Sho\r
- { 18, 9, 9, 3, V_SHO, "sho", shoArray }, // Sho duplicat\r
- { 30, 15, 15, 5, V_DAI, "dai", daiArray }, // Dai\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
- { 22, 11, 11, 3, V_WA, "wa-shogi",waArray}, // Wa\r
- { 16, 8, 8, 1, V_WOLF, "werewolf",wolfArray}, // Wa\r
+ { 24, 12, 12, 4, V_CHU, "chu", chuArray, chuIDs }, // Chu\r
+ { 16, 8, 8, 1, V_CHESS, "nocastle", chessArray,chessIDs }, // FIDE\r
+ { 18, 9, 9, 3, V_SHO, "9x9+0_shogi", shoArray, chuIDs }, // Sho\r
+ { 18, 9, 9, 3, V_SHO, "sho", shoArray, chuIDs }, // Sho duplicat\r
+ { 30, 15, 15, 5, V_DAI, "dai", daiArray, daiIDs }, // Dai\r
+ { 32, 16, 16, 5, V_TENJIKU, "tenjiku", tenArray, tenIDs }, // Tenjiku\r
+ { 16, 8, 8, 1, V_SHATRANJ,"shatranj",shatArray, chessIDs}, // Shatranj\r
+ { 16, 8, 8, 3, V_MAKRUK, "makruk", thaiArray, chessIDs}, // Makruk\r
+ { 16, 8, 8, 1, V_LION, "lion", lionArray, chessIDs}, // Mighty Lion\r
+ { 22, 11, 11, 3, V_WA, "wa-shogi", waArray, waIDs}, // Wa\r
+ { 16, 8, 8, 1, V_WOLF, "werewolf",wolfArray, chessIDs}, // Wa\r
\r
{ 0, 0, 0, 0, 0 }, // sentinel\r
{ 34, 17, 17, 0, V_DADA, "dada", chuArray }, // Dai Dai\r
}\r
if(c == '/') break;\r
name[1] = name[2] = 0;\r
- if(c == ':') name[0] = *array++, name[1] = *array++;\r
- if(name[0] >= 'a') {\r
+ if(c >= 'a') {\r
color = BLACK;\r
- name[0] += 'A' - 'a';\r
- if(name[1]) name[1] += 'A' - 'a';\r
+ c += 'A' - 'a';\r
} else color = WHITE;\r
+ if(*array == '\'') c += 26, array++; else\r
+ if(*array == '!') c += 52, array++;\r
+ name[0] = IDs[2*(c - 'A')];\r
+ name[1] = IDs[2*(c - 'A') + 1]; if(name[1] == ' ') name[1] = 0;\r
if(!strcmp(name, "CP") || pflag && !strcmp(name, "DE")) prince |= color+1; // remember if we added Crown Prince\r
p1 = LookUp(name, var);\r
if(!p1) printf("tellusererror Unknown piece '%s' in setup\n", name), exit(-1);\r
bHeight = variants[var].boardRanks;\r
zone = variants[var].zoneDepth;\r
array = variants[var].array;\r
+ IDs = variants[var].IDs;\r
}\r
bsize = bWidth*bHeight;\r
chuFlag = (currentVariant == V_CHU || currentVariant == V_LION);\r