From cc5b40fd875071c7a13aaf4ab203bd423b87c619 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 7 Oct 2011 16:22:33 +0200 Subject: [PATCH] Select Cambodian Chess by separate option A -check option is added to select Cambodian rules in Makruk, so that this can now be played as Makruk under WinBoard. (This was needed to get the promotion rules right.) The Cambodian Chess definition in the ini file is changed from fairy/Cambodian to cambodian, and special code makes this substitution for makruk. --- data/fmax.ini | 2 +- fairymax.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/data/fmax.ini b/data/fmax.ini index a1d6644..a14f75c 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -305,7 +305,7 @@ n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 R:630 1,3 16,3 -1,3 -16,3 // Cambodian Chess. Like Makruk, but with extra initial King and Met moves -Game: fairy/Cambodian # PN.R.M....SKpn.r.m....sk +Game: cambodian 8x8 13 12 8 3 7 8 12 13 13 12 9 7 4 9 12 13 diff --git a/fairymax.c b/fairymax.c index 98ff2cf..ba9672f 100644 --- a/fairymax.c +++ b/fairymax.c @@ -90,6 +90,7 @@ int Fifty; int UnderProm; int GameNr; int Resign; +int Cambodian; int Threshold = 800; int Score; int makruk; @@ -441,6 +442,7 @@ void PrintOptions() printf("feature option=\"Ini File -file %s\"\n", inifile); printf("feature option=\"Multi-PV Margin -spin %d 0 1000\"\n", margin); printf("feature option=\"Variant fairy selects -combo "); PrintVariants(1); printf("\"\n"); + printf("feature option=\"Cambodian Makruk rules -check %d\"\n", Cambodian); printf("feature option=\"Dummy Slider Example -slider 20 0 100\"\n"); printf("feature option=\"Dummy String Example -string happy birthday!\"\n"); printf("feature option=\"Dummy Path Example -path .\"\n"); @@ -465,6 +467,7 @@ int LoadGame(char *name) gating = 0; if(name != NULL) { /* search for game name in definition file */ + if(!strcmp(name, "makruk") && Cambodian) name = "cambodian"; else if(!strcmp(name, "fairy")) name = selectedFairy; gating = !strcmp(name, "seirawan"); while((ptc=fscanf(f, "Game: %s # %s", buf, pieceToChar))==0 || strcmp(name, buf) ) { @@ -732,6 +735,7 @@ int main(int argc, char **argv) if(sscanf(line+7, "Clear Hash") == 1) for(i=0; iK = 0; if(sscanf(line+7, "MultiVariation Margin=%d", &margin) == 1) continue; if(sscanf(line+7, "Variant fairy selects=%s", selectedFairy+6) == 1) continue; + if(sscanf(line+7, "Cambodian Makruk rules=%d", &Cambodian) == 1) continue; continue; } if (!strcmp(command, "go")) { -- 1.7.0.4