From 96cced96012f90c18c96d4ca2ab0c0b8ce1e5675 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 15 May 2014 23:12:27 +0200 Subject: [PATCH] Make it possible to run tsume search without King --- hachu.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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 -- 1.7.0.4