From: H.G. Muller Date: Fri, 15 Jan 2010 11:28:04 +0000 (+0100) Subject: Implement variant Makruk X-Git-Tag: 4.8O~8 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=af07349064b580cfaba648a5395a64e6b73d7f9f;p=fairymax.git Implement variant Makruk Add Makruk support in the form of 6th-rank promotion (enabled through a kludge based on the 'Queen' piece value). Add Makruk as new variant to the fmax.ini file, and mention it in the man page. --- diff --git a/changelog b/changelog index 631e117..0fb698d 100644 --- a/changelog +++ b/changelog @@ -48,6 +48,7 @@ /* 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 @@ -65,4 +66,10 @@ 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. + diff --git a/data/fmax.ini b/data/fmax.ini index 1eeb76a..aaf5cbe 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -174,6 +174,9 @@ and the last one for black. If more than two have the same name, the 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: In the last hexadecimal digit: 1 capture allowed (of enemy piece; own pieces always block a move) @@ -262,6 +265,24 @@ q:180 15,7 17,7 -15,7 -17,7 e:110 30,7 34,7 -30,7 -34,7 f:180 15,7 17,7 -15,7 -17,7 +// Thai Chess. Note: value m = 181 controls promotion at 6th! +Game: makruk +8x8 +6 4 5 7 3 5 4 6 +6 4 8 3 7 8 4 6 +p:100 -16,6 -15,5 -17,5 +p:100 16,6 15,5 17,5 +k:-1 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 +n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 +s:300 15,7 17,7 -15,7 -17,7 -16,7 +R:630 1,3 16,3 -1,3 -16,3 +m:181 15,7 17,7 -15,7 -17,7 +s:300 15,7 17,7 -15,7 -17,7 16,7 +f:181 15,7 17,7 -15,7 -17,7 +q:181 15,7 17,7 -15,7 -17,7 +b:300 15,7 17,7 -15,7 -17,7 -16,7 +b:300 15,7 17,7 -15,7 -17,7 16,7 + // Medieval intermediate between Shatranj and FIDE Chess Game: courier 12x8 diff --git a/fairymax.c b/fairymax.c index aa845dc..b5086d5 100644 --- a/fairymax.c +++ b/fairymax.c @@ -92,6 +92,7 @@ int GameNr; int Resign; int Threshold = 800; int Score; +int makruk; char piecename[32], piecetype[32], blacktype[32]; char *inifile = INI_FILE; @@ -192,6 +193,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ +(w[b[x^16]&15]<0)) /*** cling to magnetic K ***/ +(R-76>>2); /* end-game Pawn-push bonus */ b[y]+=V=y+r+1&S?647-p:2*(u&y+16&32); /* upgrade P or convert to Q*/ + if(V&makruk)b[y]=u|7,V=480; /* Makruk promotion on 6th */ V>>=sh; /* for Shatranj promo to F */ i+=V; /* promotion / passer bonus */ } if(z&S && GamePtr<6) v+=(rand()>>10&31)-16; @@ -469,6 +471,7 @@ int LoadGame(char *name) fclose(f); sh = w[7] < 250 ? 3 : 0; + makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions } int main(int argc, char **argv) diff --git a/fmax.6.pod b/fmax.6.pod index 6acae53..e495219 100644 --- a/fmax.6.pod +++ b/fmax.6.pod @@ -18,7 +18,7 @@ B is a program that plays chess and chess variants. 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