X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=98ff2cfb50aac3a2d397cabc9ceeee8f1b78460e;hb=58bbc6e831d3989c22e6e6ce1e869224355b9f0e;hp=d72a13b7c24411bc2ab5b6f89c6521eb3b925fe9;hpb=183d27789ac4c36ace275b6e7f3380df240986e9;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index d72a13b..98ff2cf 100644 --- a/fairymax.c +++ b/fairymax.c @@ -255,7 +255,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ } s=t;v=r^flag>>12; /* calc. alternated vector */ if(flag&15^4|u&32|| /* no double or moved before*/ - p>2&& /* no P & no lateral K move,*/ + 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*/ @@ -382,7 +382,7 @@ InitGame() for(i=0;i<16*BH;i++)b[i]=0; for(i=0;i<32;i++)pl[i]=0; K=BW;W(K--) - {b[K]=oo[K+16]+16;b[K+112]=oo[K];b[K+16]=18;b[K+96]=1; /* initial board setup*/ + {b[K]=oo[K+16]+16;b[K+112]=oo[K];b[K+16+16*!!makruk]=18;b[K+96-16*!!makruk]=1; /* initial board setup*/ pl[oo[K+16]+16]++;pl[oo[K]]++;pl[18]++;pl[1]++; if(w[oo[K+16]+16] == -1)pl[oo[K+16]+16]=1; if(w[oo[K]] == -1)pl[oo[K]]=1; @@ -412,7 +412,7 @@ void CopyBoard(int s) void PrintVariants(int combo) { - int i, j, count=0, total=0; char c, buf[80]; + int i, j, count=0, total=0; char c=EOF+1, buf[80]; FILE *f; f = fopen(INI_FILE, "r"); @@ -866,6 +866,7 @@ int main(int argc, char **argv) else { int i=-1; if(b[L] && (b[L]&16) == Side && w[b[L]&15] < 0) // capture own King: castling { i=K; K = L; L = i>L ? i-1 : i+2; } + if(w[GT&15] < -1) pl[GT&31]++, J+=89729; // promotion to royal piece if(b[K]&32) GT = 0; // non-virgin mover => true promotion rather than gating if(D(Side,-I,I,Q,O,LL|S,3)!=I) { /* did have move syntax, but illegal move */