X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=blobdiff_plain;f=fairymax.c;h=568a08f363eaf1c5267772948b67ac799c4e9119;hp=72dba19ca4797724eafa1feb36741cf748b6e106;hb=25b177d809f72250a6ec78df11fb84ccff1fe4ad;hpb=2fb83e0335fabebfcb66dbaf9deeb4dabdebf4f8 diff --git a/fairymax.c b/fairymax.c index 72dba19..568a08f 100644 --- a/fairymax.c +++ b/fairymax.c @@ -104,7 +104,7 @@ char Cambodian[80] = "makruk"; int Threshold = 800; int Score; int makruk; -int prom, pm, gating, succession; +int prom, pm, gating, succession, hill; char piecename[32], piecetype[32], blacktype[32]; char selectedFairy[80]; char *inifile = INI_FILE; @@ -170,6 +170,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ do{u=b[x]; /* scan board looking for */ if(u&&(u&16)==k) /* own piece (inefficient!)*/ {r=p=u&15; /* p = piece type (set r>0) */ + if(hill&&w[p]<0&b[385+x])m=I,d=98; /* King on the hill: we won */ j=od[p]; /* first step vector f.piece*/ W(r=o[++j]) /* loop over directions o[] */ {A: /* resume normal after best */ @@ -198,7 +199,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/ if(d-!t>1) /*** all captures if d=2 ***/ {v=gt=0;G: /* retry move with gating */ - v+=centr[p]?b[x+257]-b[y+257]:0; /* center positional pts. */ + v+=centr[p]*(b[x+257]-b[y+257]); /* center positional pts. */ if(G-S)b[FF]=(rk=b[G])|32,v+=50; /* castling: put R & score */ b[G]=b[H]=0;b[x]=gt;b[y]=u|32; /* do move, set non-virgin */ pl[t&31]-=!!t; /* updat victim piece count */ @@ -400,8 +401,9 @@ void InitGame() 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; - L=8;W(L--)b[16*L+K+257]=(K-BW/2)*(K-BW/2)+(L-3.5)*(L-3.5); /* center-pts table */ + L=8;W(L--)b[16*L+K+257]=(K-BW/2+hill/2.)*(K-BW/2+hill/2.)+(L-3.5)*(L-3.5); /* center-pts table */ } /*(in unused half b[])*/ + b[385+16*3+BW/2]=b[385+16*4+BW/2]=b[385+16*3+BW/2-1]=b[385+16*4+BW/2-1]=1; /* hill */ for(i=0; i15 || j>255) break; } - sh = w[7] < 250 ? 3 : 0; + sh = w[7] < 250 ? 3 : 0; hill = (w[3] == -2); if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN if(ptc == 2) printf("setup (%s) ", pieceToChar); else printf("setup (%s) %dx%d+0_%s ", pieceToChar, BW, BH, parent); @@ -579,6 +581,7 @@ int main(int argc, char **argv) if(tlim>TimeLeft/15) tlim = TimeLeft/15; PromPiece = 0; /* Always promote to Queen ourselves */ N=0;K=I; + if(hill) centr[3] = R>20 ? 1 : 22-R; if (D(Side,-I,I,Q,O,LL|S,3)==I) { Side ^= BLACK^WHITE; m = GetTickCount() - Ticks;