#define promoGain (rawGain + 1)
int pvStack[MAXPLY*MAXPLY/2];
-int nrRanks, nrFiles, specials, pinCodes, maxDrop, moveSP, pawn, queen, lanceMask, *pvPtr = pvStack, boardEnd, perpLoses, searchNr;
+int nrRanks, nrFiles, specials, pinCodes, maxDrop, moveSP, pawn, queen, lanceMask, knightLim, *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];
};
#define TORI_NR 6 /* must correspond to index of torishogi (which must be last) in table above! */
+#define KNIGHTLESS 4 /* first variant without a Knight (except mini-, which has no 2-rank zone) */
// info per piece type. sometimes indexed by negated holdings count instead of piece
#define pieceKey (rawKey+1)
startPos= variants[v].fen;
codes = variants[v].proms;
lanceMask = lances[v];
+ knightLim = (v >= KNIGHTLESS) * 6; // 6 for variants where last piece can be dropped on last two ranks
perpLoses = v; // this works for now, as only zh allows perpetuals
if((p = betza[v])) { // configure GUI for this variant
if(!(zoneTab[x] & stm)) i = 0; // outside zone, so dropping is always allowed
else if(perpLoses < TORI_NR) { // Shogi variant with Lance
i *= 2; // no Pawn, then also no Lance!
- last += 1 - (zoneTab[x] & (Z_2ND & ~COLOR)) + (perpLoses & 4) >> 3; // on last 2 ranks trim off Knight (not in Wa)
+ last -= (zoneTab[x] & (Z_2ND & ~COLOR)) > knightLim; // on last 2 ranks trim off Knight (not in Wa)
}
if(pawnCount[sqr2file[x]] & maxBulk[stm]) i += !i; // no Pawn in pawn-crowded file
}