v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/\r
if(d-!t>1) /*** all captures if d=2 ***/\r
{v=centr[p]?b[x+257]-b[y+257]:0; /* center positional pts. */\r
+ if(!(G&S))b[FF]=b[G],v+=50; /* castling: put R & score */\r
b[G]=b[H]=b[x]=0;b[y]=u|32; /* do move, set non-virgin */\r
- if(!(G&S))b[FF]=k+6,v+=50; /* castling: put R & score */\r
v-=w[p]>0|R<EG?0:20; /*** freeze K in mid-game ***/\r
if(p<3) /* pawns: */\r
{v-=9*((x-2&M||b[x-2]-u)+ /* structure, undefended */\r
} /* K-capt. replies) */\r
J=f;Z=g;\r
SHAMAX( pl[k]+=!!t; )\r
- b[G]=k+6;b[FF]=b[y]=0;b[x]=u;b[H]=t; /* undo move,G can be dummy */\r
+ b[G]=b[FF];b[FF]=b[y]=0;b[x]=u;b[H]=t; /* undo move,G can be dummy */\r
} /* if non-castling */\r
if(z&S&&Post&K==I&d>2&v>V&v<l){int *p=ps;char X,Y;\r
printf("%2d ",d-2);\r
while(*p){X=*p>>8;Y=*p++;\r
printf(" %c%c%c%c",'a'+(X&15),'8'-(X>>4),'a'+(Y&15),'8'-(Y>>4&7));}\r
printf("\n");fflush(stdout);\r
- } if(v>m) /* new best, update max,best*/\r
+ }
+ if(v>m) /* new best, update max,best*/\r
m=v,X=x,Y=y|S&F; /* mark non-double with S */\r
if(h){h=0;goto A;} /* redo after doing old best*/\r
}\r
- s=t;\r
+ s=t;v=r^flag>>12; /* calc. alternated vector */\r
if(flag&15^4|u&32|| /* no double or moved before*/\r
p>2&& /* no P & no lateral K move,*/\r
((b[G=r<0?x&~15:BW-1|x&112]^32)<33 /* no virgin R in corner G, */\r
- ||b[G^1]|b[G^2]|b[FF=r<0?G+3:G-2]) /* no 2 empty sq. next to R */\r
+ ||b[G^1]|b[G^2]|b[FF=y+v-r]) /* no 2 empty sq. next to R */\r
)t+=flag&4; /* fake capt. for nonsliding*/\r
else F=y; /* enable e.p. */\r
if(s&&flag&8)t=0,flag^=flag>>4&15; /* hoppers go to next phase */\r
if(!(flag&S)) /* zig-zag piece? */\r
- r^=flag>>12,flag^=flag>>4&15; /* alternate vector & mode */\r
+ r=v,flag^=flag>>4&15; /* alternate vector & mode */\r
}W(!t); /* if not capt. continue ray*/\r
}}\r
if((++x&15)>=BW)x=x+16&112; /* next sqr. of board, wrap */\r