X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=9b80061b62440a871477d8906f0b112f2659fb96;hb=04cab86f1aaa0720980153e862ce8641beee489b;hp=568a08f363eaf1c5267772948b67ac799c4e9119;hpb=25b177d809f72250a6ec78df11fb84ccff1fe4ad;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 568a08f..9b80061 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 */ @@ -266,15 +266,15 @@ 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; /* calc. 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)t=0,flag^=flag>>4&15; /* hoppers go to next phase */ - if(--rg<0&!(flag&S)) /* zig-zag piece? (w. delay)*/ + 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*/ }} @@ -580,6 +580,9 @@ int main(int argc, char **argv) tlim = (0.6-0.06*(BW-8))*(TimeLeft+(m-1)*TimeInc)/(m+7); if(tlim>TimeLeft/15) tlim = TimeLeft/15; PromPiece = 0; /* Always promote to Queen ourselves */ + for(N=K=0;K>8<2)centr[4]=5;if(!(N&S-2))centr[3]=5;Z+=R>4;R=4;} +printf("# %04x pieces, centr = (%d,%d)\n", N, centr[3], centr[4]); N=0;K=I; if(hill) centr[3] = R>20 ? 1 : 22-R; if (D(Side,-I,I,Q,O,LL|S,3)==I) { @@ -587,6 +590,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));