X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=3bd0c69fd8b1a4900641075a6d98d408737f0994;hb=a9a64259112f5f7a05ff03b2226a18ae4df1e254;hp=6f420ae8969c7fb5d4e1ec4d9a46219a082d72b7;hpb=b170de109dfcfa9db25c93006f9e1ef417243aa9;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 6f420ae..3bd0c69 100644 --- a/fairymax.c +++ b/fairymax.c @@ -149,7 +149,7 @@ D(k,q,l,e,E,z,n) /* recursive minimax search, k=moving side, n=depth*/ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ { /* e=score, z=prev.dest; J,Z=hashkeys; return score*/ int j,r,m,v,d,h,i,F,G,P,V,f=J,g=Z,C,s,flag,FF,*ps=sp,kk=S; - signed char t,p,u,x,y,X,Y,H,B,gt; + signed char t,p,u,x,y,X,Y,H,B,gt,rg; struct _*a=A+(J+(k+S)*E&U); /* lookup pos. in hash table*/ *sp++=0; q-=q>10&3; /* (x,y)=move, (F,G)=castl.R*/ do{ /* y traverses ray, or: */ H=y=h?Y^h:y+r; /* sneak in prev. best move */ if(flag&1<<8)H=y=(y&15)>13?y+BW:(y&15)>=BW?y-BW:y; /* cylinder board */ @@ -218,7 +218,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ v+=e+i;V=m>q?m:q; /*** new eval & alpha ****/ if(z&S)V=m-margin>q?m-margin:q; /* multiPV */ C=d-1-(d>5&p>2&!t&!h); /* nw depth, reduce non-cpt.*/ - C=R0?C:d; /* extend 1 ply if in-check */ do s=C>2|v>V?-D(16-k,-l,-V,-v,/*** futility, recursive eval. of reply */ F,y&255,C):v; @@ -232,7 +232,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ {if(v+I&&x==K&y==L>==GT) /* if move found */ {Q=-e-i;O=F;LL=L;prom=gt; if(b[y]-u&15)prom=b[y]-=PromPiece, /* (under-)promotion: */ - Q-=abs(w[prom&=15])-w[p]-6*S, /* correct piece & score & */ + Q-=abs(w[prom&=15])-w[p]-(6*S>>sh), /* correct piece & score & */ Z+=PromPiece; /* invalidate hash */ a->D=99;a->V=0; /* lock game in hash as draw*/ R-=i/FAC; /*** total captd material ***/ @@ -273,7 +273,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*/ else if(flag&64)t=flag&128?0:t,flag&=63;else F=y; /* enable e.p. */ if(s&&flag&8)t=0,flag^=flag>>4&15; /* hoppers go to next phase */ - if(!(flag&S)) /* zig-zag piece? */ + if(--rg<0&!(flag&S)) /* zig-zag piece? (w. delay)*/ r=v,flag^=flag>>4&15; /* alternate vector & mode */ }W(!t); /* if not capt. continue ray*/ }}