Add option do adjust 50-moves draw claim
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 12 Oct 2014 09:04:48 +0000 (11:04 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 12 Oct 2014 09:04:48 +0000 (11:04 +0200)
The number of reversible moves after which a draw claim is emitted
is now adjustable through an engine-defined option.

fairymax.c

index 281ccbf..418c926 100644 (file)
@@ -102,6 +102,7 @@ int GameNr;
 int Resign;\r
 char Cambodian[80] = "makruk";\r
 int Threshold = 800;\r
+int drawMoves = 50;\r
 int Score;\r
 int makruk;\r
 int prom, pm, gating, succession, hill;\r
@@ -375,7 +376,7 @@ int PrintResult(int s)
                 }\r
                 return 3;\r
         }\r
-        if(Fifty >=100) {\r
+        if(Fifty >= 2*drawMoves) {\r
                 printf("1/2-1/2 {Draw by fifty move rule}\n");\r
                 return 4;\r
         }\r
@@ -459,6 +460,7 @@ void PrintOptions()
        printf("feature option=\"Multi-PV Margin -spin %d 0 1000\"\n", margin);\r
        printf("feature option=\"Variant fairy selects -combo "); PrintVariants(1); printf("\"\n");\r
        printf("feature option=\"Makruk rules -combo makruk /// Cambodian /// Ai-wok\"\n");\r
+       printf("feature option=\"Claim draw after -spin %d 0 200\"\n", drawMoves);\r
        printf("feature option=\"Dummy Slider Example -slider 20 0 100\"\n");\r
        printf("feature option=\"Dummy String Example -string happy birthday!\"\n");\r
        printf("feature option=\"Dummy Path Example -path .\"\n");\r
@@ -759,6 +761,7 @@ printf("# promo = %d (%c) GT = %d\n", prom, prom + '`', GT);
                        if(sscanf(line+7, "MultiVariation Margin=%d", &margin) == 1) continue;\r
                        if(sscanf(line+7, "Variant fairy selects=%s", selectedFairy+6) == 1) continue;\r
                        if(sscanf(line+7, "Makruk rules=%s", Cambodian) == 1) continue;\r
+                       if(sscanf(line+7, "Claim draw after=%d", &drawMoves) == 1) continue;\r
                        continue;\r
                }\r
                if (!strcmp(command, "go")) {\r