Fix ASEAN Chess
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 12 Oct 2014 09:46:28 +0000 (11:46 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 12 Oct 2014 09:46:28 +0000 (11:46 +0200)
Variant asean did not put the Pawns on 3rd rank since the "=3" suffix
was used to indicate Makruk, as ASEAN has a normal 1-rank promotion zone.
By adding "=1" as a kludge, and later resetting the 'makruk' variable
that controls the zone width, it now sets up the correct position.

data/fmax.ini
fairymax.c

index 57b05bb..0d3bf72 100644 (file)
@@ -329,7 +329,7 @@ f:180 15,7 17,7 -15,7 -17,7
 \r
 // ASEAN Chess. New form of Makruk\r
 Game: asean\r
-8x8\r
+8x8=1\r
 13 12 8 7 3 8 12 13\r
 13 12 9 7 4 9 12 13\r
 p:100 -16,6 -15,5 -17,5 \r
index 418c926..007e542 100644 (file)
@@ -503,7 +503,7 @@ void LoadGame(char *name)
         /* We have found variant, or if none specified, are at beginning of file */\r
         if(fscanf(f, "%dx%d", &BW, &BH)!=2 || BW>12 || BH!=8)\r
         { printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); }\r
-        makruk = 0; if(fscanf(f, "=%d", &i)) makruk=64; // new method to indicate deviant zone depth (for now assumes 3)\r
+        makruk = 0; if(fscanf(f, "=%d", &i)) makruk=67-i; // new method to indicate deviant zone depth (for now assumes 3)\r
 \r
         for(i=0; i<BW; i++) fscanf(f, "%d", oo+i);\r
         for(i=0; i<BW; i++) fscanf(f, "%d", oo+i+16);\r
@@ -539,6 +539,7 @@ void LoadGame(char *name)
         }\r
        while(fscanf(f, " # %[^\n]", pieceToChar)) printf("piece %s\n", pieceToChar);\r
         fclose(f);\r
+       if(makruk != 64) makruk = 0; // 66 was kludge to interpret "=1" suffix in asean for setting up 3rd-rank Pawns\r
 }\r
 \r
 int main(int argc, char **argv)\r