From 021a095ce431356fef12951397617d81291d2c8a Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 12 Oct 2014 10:13:05 +0200 Subject: [PATCH] Let bare King paint itself out of a corner A bare King now increses the centralization bonus of any square it visits at game level. This implements a perpetually increasing 'stay-put bonus' for loitering in the same location, and makes the strong side eventually decide to drive the bare King out of a corner where it cannot be checkmated. This only works in games where the white and black King are defined as separate piece types (as there is no bare-King recognition otherwise)! --- fairymax.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fairymax.c b/fairymax.c index 9b80061..281ccbf 100644 --- a/fairymax.c +++ b/fairymax.c @@ -238,6 +238,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ a->D=99;a->V=0; /* lock game in hash as draw*/ R-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; + if(centr[p]==5)b[257+y]-=5; sp=ps; return l;} /* & not in check, signal */ v=m; /* (prevent fail-lows on */ @@ -582,7 +583,7 @@ int main(int argc, char **argv) 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]); +printf("# %d+%d pieces, centr = (%d,%d)\n", N&63, N>>7, 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) { -- 1.7.0.4