X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=769da7f25c4d1d7ee0af79240ec5c5adf6a83a94;hb=0a8207c5bba7eac72a459e18be5cbd8df35b1704;hp=15a5ce542683134c30c6d6acc40f3c8fe21f0013;hpb=804ec8ebc971e4e92c96e7209df3f0743a36a70b;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 15a5ce5..769da7f 100644 --- a/fairymax.c +++ b/fairymax.c @@ -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; @@ -231,8 +231,9 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ if(z&S&&K-I) /* move pending: check legal*/ {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, correct */ - Z+=PromPiece; /* piece & invalidate hash */ + if(b[y]-u&15)prom=b[y]-=PromPiece, /* (under-)promotion: */ + Q-=abs(w[prom&=15])-w[p]-6*S, /* 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 ***/ Fifty = t|p<3?0:Fifty+1; @@ -582,7 +583,7 @@ int main(int argc, char **argv) printf("move "); printf("%c%c%c%c",'a'+(K&15),'0'+BH-(K>>4), 'a'+(L&15),'0'+BH-(L>>4)); - if(prom)printf("%c",piecename[prom&15]+'a'-1); + if(prom)printf("%c",piecename[prom]+'a'-1); printf("\n"); /* time-control accounting */