From: H.G.Muller Date: Fri, 3 Oct 2014 08:22:51 +0000 (+0200) Subject: Use '2'-bit of range field to flag hop-friend X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=eaf83ea88d9567c38081aae39be668676edce3e2 Use '2'-bit of range field to flag hop-friend The possibility to 'collide' from the hop platform by first stepping back a number of squares before starting the second leg is now restricted to one square, as indicated by the '1'-bit of the range field, for hoppers. The '2' bit now flags that only a friendly piece can be used as platform; an enemy counts as empty in the hop test, but because there is an actual piece there it will terminate the ray (as no hop will reset that then). --- diff --git a/fairymax.c b/fairymax.c index 9b3adc7..470c03a 100644 --- a/fairymax.c +++ b/fairymax.c @@ -266,14 +266,14 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ J=f;Z=g; if(h){h=0;goto A;} /* redo after doing old best*/ } - s=t;v=r^flag>>12; /* capt & alternated vector */ + s=t&&2&~rg|~t&16^k;v=r^flag>>12; /* platform & toggled vector*/ if(flag&15^4|u&32|| /* no double or moved before*/ p>2&!(flag&S)&& /* no P & no virgin jump, */ ((b[G=r<0?x&~15:BW-1|x&112]^32)<33 /* no virgin R in corner G, */ ||b[G^1]|b[G^2]|b[FF=y+v-r]) /* no 2 empty sq. next to R */ )t+=flag&4; /* fake capt. for nonsliding*/ else if(flag&64)t=flag&128?0:t,flag&=63;else F=y; /* enable e.p. */ - if(s&&flag&8&&!(y-=rg*r,t=0) /* hoppers go to next phase */ + if(s&&flag&8&&!(y=rg&1?y-r:y,t=0) /* hoppers go to next phase */ ||!(flag&S)&&--rg<0) /* zig-zag piece? (w. delay)*/ r=v,flag^=flag>>4&15; /* alternate vector & mode */ }W(!t); /* if not capt. continue ray*/