From: H.G. Muller Date: Thu, 15 May 2014 21:12:27 +0000 (+0200) Subject: Make it possible to run tsume search without King X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=96cced96012f90c18c96d4ca2ab0c0b8ce1e5675;p=hachu.git Make it possible to run tsume search without King --- diff --git a/hachu.c b/hachu.c index 869a9b8..711ec43 100644 --- a/hachu.c +++ b/hachu.c @@ -1641,6 +1641,8 @@ Evaluate (int difEval) { int wLion = ABSENT, bLion = ABSENT, wKing, bKing, score=mobilityScore, f, i, j, max=512; + if(tsume) return difEval; + if(p[WHITE+2].value == LVAL) wLion = p[WHITE+2].pos; if(p[BLACK+2].value == LVAL) bLion = p[BLACK+2].pos; if(wLion == ABSENT && p[WHITE+4].value == LVAL) wLion = p[WHITE+4].pos; @@ -1812,7 +1814,7 @@ if(!level) {for(i=0; i<5; i++)printf("# %d %08x, %d\n", i, repStack[200-i], chec } } else { // he has no king! Test for attacks on Crown Prince k = p[king + 2].pos; - if(k == ABSENT || attacks[2*k + stm]) return INF; // we have attack on Crown Prince + if(k == ABSENT ? !tsume : attacks[2*k + stm]) return INF; // we have attack on Crown Prince } //printf("King safe\n");fflush(stdout); // EVALUATION & WINDOW SHIFT