/* L) added Resign option feature (using new WB protocol) */
/* M) char -> signed char for better portability */
/* N) add PV printing and multi-PV support */
+/* O) non-Rook castling, 6th-rank promotion, independent B/W piece naming */
/***************************************************************************/
4/6/2009 Unified source of ShaMax and Fairy-Max into single fmax.c file, and
a multi-PV option to print lines within a certain sccore margin.
15/1/2010 Improved Makefile, updated docs
+ Implement independent naming of white and black pieces. (So mirror-
+ image pieces can use same letter.)
+ Change castling code to allow castling with any corner piece type.
+ Implement 6th-rank promotion based on 'Queen' value.
+ Makruk added as new variant to the fmax.ini file.
+
others cannot be indicated at all, but they could still occur in the
initial setup (where you specify them by number, not letter).
+NOTE: piece value 181 for piece 7 is reserved for Makruk, and enables
+promotion on the 6th rank. Do not use it in other variants.
+
The individual bits in the move-mode descriptor have the following meaning:\r
In the last hexadecimal digit:\r
1 capture allowed (of enemy piece; own pieces always block a move)\r
e:110 30,7 34,7 -30,7 -34,7\r
f:180 15,7 17,7 -15,7 -17,7\r
\r
+// Thai Chess. Note: value m = 181 controls promotion at 6th!\r
+Game: makruk\r
+8x8\r
+6 4 5 7 3 5 4 6\r
+6 4 8 3 7 8 4 6\r
+p:100 -16,6 -15,5 -17,5 \r
+p:100 16,6 15,5 17,5\r
+k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7\r
+n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7\r
+s:300 15,7 17,7 -15,7 -17,7 -16,7\r
+R:630 1,3 16,3 -1,3 -16,3\r
+m:181 15,7 17,7 -15,7 -17,7\r
+s:300 15,7 17,7 -15,7 -17,7 16,7\r
+f:181 15,7 17,7 -15,7 -17,7\r
+q:181 15,7 17,7 -15,7 -17,7\r
+b:300 15,7 17,7 -15,7 -17,7 -16,7\r
+b:300 15,7 17,7 -15,7 -17,7 16,7\r
+\r
// Medieval intermediate between Shatranj and FIDE Chess\r
Game: courier\r
12x8\r
int Resign;\r
int Threshold = 800;\r
int Score;\r
+int makruk;\r
char piecename[32], piecetype[32], blacktype[32];\r
char *inifile = INI_FILE;\r
\r
+(w[b[x^16]&15]<0)) /*** cling to magnetic K ***/\r
+(R-76>>2); /* end-game Pawn-push bonus */\r
b[y]+=V=y+r+1&S?647-p:2*(u&y+16&32); /* upgrade P or convert to Q*/\r
+ if(V&makruk)b[y]=u|7,V=480; /* Makruk promotion on 6th */\r
V>>=sh; /* for Shatranj promo to F */\r
i+=V; /* promotion / passer bonus */\r
} if(z&S && GamePtr<6) v+=(rand()>>10&31)-16;\r
\r
fclose(f);\r
sh = w[7] < 250 ? 3 : 0;\r
+ makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions\r
}\r
\r
int main(int argc, char **argv)\r
It uses the xboard/winboard chess-engine protocol to communicate.
Apart from 'regular' chess (also known as the Mad-Queen variant),
it can play Capablanca chess, gothic chess, knightmate, cylinder chess,
-berolina chess, superchess and courier chess.
+berolina chess, superchess, makruk (Thai chess) and courier chess.
Fairy-Max can be easily configured by the user to play other variants as well,
by modifying the ini file.
This ini file describes the rules of movement