-#define VERSION "1.0.4"
+#define VERSION "1.0.5"
/********************************************************************************************/
/* Simple XBoard-compatible engine for playing Chess variants with drops, by H.G. Muller. */
#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];
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
}
}
- 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