Toggle mode & direction only once on riders
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 13 Oct 2014 09:32:55 +0000 (11:32 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 13 Oct 2014 09:32:55 +0000 (11:32 +0200)
Rather than toggling the mode and direction every step after the
range count runs out, (as needed for crooked pieces), we now only
toggle when the range expires (so we can define bent riders).

data/fmax.ini
fairymax.c

index 1c28c20..4f7e297 100644 (file)
@@ -108,8 +108,6 @@ Canvasser:
 C:900 1,3 16,3 -1,3 -16,3 13,7 47,7 49,7 19,7 -13,7 -47,7 -49,7 -19,7\r
 Amazon:\r
 A:1150 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7\r
-Crooked Bishop:\r
-B:900 15,1E003 17,1E003 -15,1E003 -17,1E003 15,FFFE0003 -17,FFFE0003 -15,FFFE0003 17,FFFE0003\r
 \r
 HOPPERS\r
 GrassHopper:\r
@@ -210,7 +208,7 @@ In the last hexadecimal digit:
     8 hop over non-empty square (normally occupied squares terminate a move)\r
 Bits set in the forelast digits TOGGLE the corresponding bits in the last\r
 digit. For hoppers when they hop over something, for the other pieces after\r
-every step (so for normal pieces, better not set those bits!).\r
+one to four steps (so for normal pieces, better not set those bits!).\r
 \r
 The digit before that indicates some special things; a 1 indicates the \r
 board should be treated as a cylinder, pieces crossing the right edge \r
@@ -239,17 +237,16 @@ Useful bit combinations for the last digit are:
     C   must hop immediately\r
 \r
 For example, if the initial step vector equals 1, and the descriptor\r
-is 11003, the piece is an alternator (as no hop bit is set), and alternates\r
+is 11003, the piece is a bent one (as no hop bit is set), and switches\r
 the mode from 3 to 3 (as the toggle digit is 0), i.e. all steps are moves\r
 that can both capture and non-capture, and only captures terminate the ray.\r
-The step vector is toggled by 11, though, and thus alternates between 1\r
-and 10 (hex) = 16. So the piece zig-zags over the board, right, forward, right,\r
-forward, etc. Had the move attributes been 11032, captures would only\r
-be allowed on the odd steps (after moving right), while the even steps could\r
-only be non-captures (both the 1 and 2 bit are toggled). With 11030 the\r
-odd steps can only be skipped (if empty), and the even steps can both capture\r
-and non-capture, meaning the piece moves like a Bishop that can be blocked\r
-by a piece just next to the diagonal.\r
+The step vector is toggled by 11, though, and thus switches from 1\r
+to 10 (hex) = 16. So the piece turns a 90-degree corner, from right to\r
+forward. Had the move attributes been 11032, captures would only be\r
+allowed before the bend (after moving right), while thereafter it can\r
+only non-capture (both the 1 and 2 bit are toggled). With 11030 the\r
+first step can only be skipped (if empty), and thereafter it can both capture\r
+and non-capture.\r
 \r
 If the first step is a slider, a second step is made (if the square was\r
 empty), but if the mode toggles to leaper, the move stops there (e.g. Horse).\r
index 007e542..2046aaa 100644 (file)
@@ -276,7 +276,7 @@ int k,q,l,e,E,z,n;      /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/
         )t+=flag&4;                            /* fake capt. for nonsliding*/\r
       else if(flag&64)t=flag&128?0:t,flag&=63;else F=y; /* enable e.p.     */\r
       if(s&&flag&8&&!(y=rg&1?y-r:y,t=0)        /* hoppers go to next phase */\r
-         ||!(flag&S)&&--rg<0)                  /* zig-zag piece? (w. delay)*/\r
+         ||!(flag&S)&&!rg--)                   /* zig-zag piece? (w. delay)*/\r
        r=v,flag^=flag>>4&15;                   /* alternate vector & mode  */\r
      }W(!t);                                   /* if not capt. continue ray*/\r
    }}\r