From: H.G.Muller Date: Tue, 10 Apr 2018 15:53:45 +0000 (+0200) Subject: Don't assume Knight to be always piece number 6 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c1236f2aabdbfee5326dc593ec01149d1d219ddb;p=crazywa.git Don't assume Knight to be always piece number 6 To determine the number of ranks where dropping is not allowed, (for pieces that have their drop-limitation flag set in lances[]), we have to distinguish the Knight. This is now done by assuming that any piece other than the first two (which are always Pawn and Lance, even if this requires the Lance to be present as a dummy) is a Knight. --- diff --git a/dropper.c b/dropper.c index e7b834c..9d1188e 100644 --- a/dropper.c +++ b/dropper.c @@ -972,7 +972,7 @@ AllDrops (int stm) if((signed char)board[from] < -1) { // piece type is in hand int r, f, start = 0, end = boardEnd; if(mask & 1) { // piece with drop limitation - int badZone = (i == 6 ? 44 : 22); // 6 is the Knight in (Judkins) Shogi + int badZone = 22 << (i > 1); // if no Pawn or Lance it must be Knight and skip 2 ranks if(stm == BLACK || !perpLoses) start = badZone; if(stm == WHITE || !perpLoses) end -= badZone; }