From 7d5a541a003b3077daf866fea158e73cb110bfc3 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 2 Nov 2010 11:22:45 +0100 Subject: [PATCH] Limit duple-check rule to piece types above 7 This to allow implementation of normal extinction variants. The definition of Spartan Chess had to be adapted to maintain the duple-check rule there, moving the King definition to the end. The piece ordering was further changed so that the black pieces now also are ordered low to high, which gives better move ordering in QS, as Fairy-Max' idea of MVV/LVA orders attacker on piece-type number, rather than the defined value. --- data/fmax.ini | 22 +++++++++++----------- fairymax.c | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/data/fmax.ini b/data/fmax.ini index 83f2a30..26c1f56 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -179,11 +179,11 @@ others cannot be indicated at all, but they could still occur in the initial setup (where you specify them by number, not letter). Pieces with negative values are considered royal. If one side has more than -one royal piece of the same type, he loses if the _last_ one is captured, -with the special rule that he is not allowed to leave more than one of -them under attack. This means the 'spare' royal pieces can be sacrificed, -and the exchange value assumed for them will be the absolute value of what -you define for them. +one royal piece of the same type, he loses if the _last_ one is captured. +For royal piece types larger than 7 there is the special rule that it is not +allowed to leave more than one of them under attack. This means the 'spare' +royal pieces can be sacrificed, and the exchange value assumed for them will +be the absolute value of what you define for them. NOTE: piece value 181 for piece 7 is reserved for Makruk, and enables promotion on the 6th rank. Do not use it in other variants. @@ -471,18 +471,18 @@ m:640 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 1,7 16,7 -1,7 -16,7 2,7 -2,7 3 // Spartan Chess, where black has a different army from white's orthodox FIDE, with two kings Game: fairy/Spartan 8x8 -6 4 5 7 3 5 4 6 -11 9 3 10 10 3 8 11 +6 4 5 7 11 5 4 6 +3 9 11 8 8 11 10 3 p:74 -16,64 -16,6 -15,5 -17,5 h:74 15,E4 17,E4 16,5 15,6 17,6 -k:-400 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 +l:270 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 1,6 -1,6 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 Q:851 1,3 16,3 15,3 17,3 -1,3 -16,3 -15,3 -17,3 -w:790 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 -G: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 -l:270 15,7 17,7 -15,7 -17,7 30,7 34,7 -30,7 -34,7 1,6 -1,6 c:250 1,7 16,7 -1,7 -16,7 2,7 -2,7 32,7 -32,7 +G: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 +w:790 15,3 17,3 -15,3 -17,3 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7 +k:-400 1,34 -1,34 1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7 // End of game file diff --git a/fairymax.c b/fairymax.c index 5b2e98a..0c1fc81 100644 --- a/fairymax.c +++ b/fairymax.c @@ -181,7 +181,8 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ if(flag&1+!t) /* mode (capt/nonc) allowed?*/ {if(t&&(t&16)==k)break; /* capture own */ i=w[t&15]+((t&192)>>sh); /* value of capt. piece t */ - if(i<0&&(pl[t&31]<2||kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* K capture, duple check */ + if(i<0&&(pl[t&31]<2|| /* K capture, (of last K), */ + t>>3&kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* or duple check: cutoff*/ if(m>=l&d>1)goto C; /* abort on fail high */ v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/ if(d-!t>1) /*** all captures if d=2 ***/ -- 1.7.0.4