From 8c2aaf3bb0ccd6863bc10a0e8521282dd286dcf0 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 18 Feb 2018 15:01:32 +0100 Subject: [PATCH] Bump version to 1.0.5 --- dropper.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dropper.c b/dropper.c index 5375ae3..5d66783 100644 --- a/dropper.c +++ b/dropper.c @@ -1,4 +1,4 @@ -#define VERSION "1.0.4" +#define VERSION "1.0.5" /********************************************************************************************/ /* Simple XBoard-compatible engine for playing Chess variants with drops, by H.G. Muller. */ @@ -65,7 +65,7 @@ int moveNr; // part of game state; incremented by MakeMove #define promoGain (rawGain + 1) int pvStack[MAXPLY*MAXPLY/2]; -int nrRanks, nrFiles, specials, pinCodes, maxDrop, moveSP, pawn, lanceMask, *pvPtr = pvStack, boardEnd, perpLoses, searchNr; +int nrRanks, nrFiles, specials, pinCodes, maxDrop, moveSP, pawn, queen, lanceMask, *pvPtr = pvStack, boardEnd, perpLoses, searchNr; int frontier, killZone, impasse, frontierPenalty, killPenalty; int rawInts[21*22], pieceValues[96], pieceCode[96]; signed char rawChar[32*22], steps[512]; @@ -575,7 +575,8 @@ GameInit (char *name) for(i=0; *ip >= 0; i++) pieceValues[WHITE+i] = pieceValues[BLACK+i] = *ip++; // basic for(i=16,ip++; *ip >= 0; i++) pieceValues[WHITE+i] = pieceValues[BLACK+i] = *ip++; // promoted for(i=0, ip++; *ip >= 0; i++) handVal[WHITE+i] = handVal[BLACK+i] = *ip++; // in hand - pawn = 2*handVal[WHITE] << 20; // used for detection of material-loosing loops + pawn = 2*handVal[WHITE] << 20; // used for detection of material-loosing loop + queen = v ? 0 : 2*handVal[WHITE+5] << 20; // losing two Queens overflows for(i=0; i<16; i++) { int demoted = dropType[handSlot[WHITE+i+16]]-1; // piece type after demotion (could be Pawn, in Chess) handVal[WHITE+i+16] = handVal[BLACK+i+16] = pieceValues[WHITE+i+16] + handVal[demoted]; // gain by capturing promoted piece @@ -1352,8 +1353,8 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction, } } - else if(gain == pawn || gain >= (400<<20)) score = INF-1; // quasi-repeat with extra piece in hand - else if(gain == -pawn || gain <= (-400<<20)) score = 1-INF; // or with one piece less + else if(gain == pawn || gain == queen || gain >= (400<<20)) score = INF-1; // quasi-repeat with extra piece in hand + else if(gain == -pawn || gain == -queen || gain <= (-400<<20)) score = 1-INF; // or with one piece less else goto search;// traded one hand piece for another; could still lead somewhere f.lim = score; f.depth = (score >= beta ? highDepth+1 : iterDepth); // minimum required depth *pvPtr = 0; // fake that daughter returned empty PV -- 1.7.0.4