From: H.G. Muller Date: Tue, 16 Nov 2010 11:36:31 +0000 (+0100) Subject: Implement variant seirawan, and add it X-Git-Tag: 4.8Q~17 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a3fd272813e903e7dcbfa9f80d27d1ecdbc08738;p=fairymax.git Implement variant seirawan, and add it The gating is implemented through a kludge: the search is not aware that pieces can be gated in, but any move that evacuates the back rank when there are pieces to be gated available, will gate one (first Hawk, then Elephant. --- diff --git a/data/fmax.ini b/data/fmax.ini index d54b803..5fd76b8 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -412,6 +412,21 @@ g:640 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 2,7 30,7 32,7 34,7 -2,7 -30,7 -3 m:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 16,70 -16,70 d:625 1,7 16,7 -1,7 -16,7 15,3 17,3 -15,3 -17,3 +// Seirawan Chess (with Archbishop and Chancellor gated in during game) +Game: seirawan +8x8 +5 3 4 7 9 4 3 5 +5 3 4 7 9 4 3 5 +p:74 -16,24 -16,6 -15,5 -17,5 +p:74 16,24 16,6 15,5 17,5 +n:259 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 +b:296 15,3 17,3 -15,3 -17,3 +R:444 1,3 16,3 -1,3 -16,3 +h:780 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 +Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 +E:814 1,3 16,3 -1,3 -16,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 +k:-1 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 + // Set for Chess with Different Armies, FIDE vs Color-bound Cloberers (legality-testing off!) Game: fairy/FIDE-Clobberers 8x8 diff --git a/fairymax.c b/fairymax.c index bb842da..205e89b 100644 --- a/fairymax.c +++ b/fairymax.c @@ -225,6 +225,8 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ R-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; sp=ps; + if(!(u&32)&PromPiece&(K&112)==(k?0:112)) + prom=b[K]=39+k-PromPiece,J++,pl[k+14-PromPiece]--; /* gating */ return l;} /* & not in check, signal */ v=m; /* (prevent fail-lows on */ } /* K-capt. replies) */ @@ -544,6 +546,7 @@ 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 */ + if(pl[Side+13])PromPiece=1;else if(pl[Side+15])PromPiece=-1; /* S-Chess gating */ N=0;K=I; if (D(Side,-I,I,Q,O,LL|S,3)==I) { Side ^= BLACK^WHITE; @@ -779,6 +782,7 @@ int main(int argc, char **argv) sscanf(line, "variant %s", command); LoadGame(command); InitGame(); Setup = 0; + if(strstr(command,"seirawan")) pl[13] = pl[15] = pl[29] = pl[31] = 1; continue; } if (!strcmp(command, "edit")) {