From: H.G.Muller Date: Wed, 8 Oct 2014 06:56:21 +0000 (+0200) Subject: Repair Seirawan gating X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=88dc8e222151bd89a99815735189eab5454f0aad Repair Seirawan gating The overhaul of promotion code had forgotton to strip off the virginity and color bits of the gated piece (gt) when assigning it to the promotion piece type. With as a result that garbage characters were printed as promotion suffix in gating moves. --- diff --git a/fairymax.c b/fairymax.c index 470c03a..5ec3380 100644 --- a/fairymax.c +++ b/fairymax.c @@ -231,7 +231,7 @@ 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; + {Q=-e-i;O=F;LL=L;prom=gt&15; if(b[y]-u&15)prom=b[y]-=PromPiece, /* (under-)promotion: */ Q-=abs(w[prom&=15])-w[p]-(6*S>>sh), /* correct piece & score & */ Z+=PromPiece; /* invalidate hash */ @@ -587,6 +587,7 @@ int main(int argc, char **argv) m = GetTickCount() - Ticks; printf("# times @ %u: real=%d cpu=%1.0f\n", m + Ticks, m, (CPUtime() - cpuT)/CLOCKS_PER_SEC); +printf("promo = %d (%c) GT = %d\n", prom, prom + '`', GT); printf("move "); printf("%c%c%c%c",'a'+(K&15),'0'+BH-(K>>4), 'a'+(L&15),'0'+BH-(L>>4));