From: H.G.Muller Date: Tue, 10 Apr 2018 16:11:19 +0000 (+0200) Subject: Allow demotion of pieces X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c458c9fd50c572c3014524d361ca749883678206;p=crazywa.git Allow demotion of pieces The promoInc is now XORed with the moving piece, rather than ORed into it. This allows moves that specify promotion (through off-board to-square) to be applied to already promoted pieces, with as a result they revert to their unpromoted form. --- diff --git a/dropper.c b/dropper.c index 9d1188e..b8f8aa6 100644 --- a/dropper.c +++ b/dropper.c @@ -1073,7 +1073,7 @@ MakeMove (StackFrame *f, int move) f->fromPiece = board[f->fromSqr]; // occupant or (for drops) complemented holdings count if(f->checker != CK_NONE && NonEvade(f)) return 0; // abort if move did not evade existing check f->mutation = (f->fromPiece >> 7) | f->fromPiece; // occupant or (for drops) -1 - f->toPiece = f->mutation + dropType[f->fromSqr] | promoInc[to]; // (possibly promoted) occupant or (for drops) piece to drop + f->toPiece = f->mutation + dropType[f->fromSqr] ^ promoInc[to]; // (possibly promoted) occupant or (for drops) piece to drop f->victim = board[f->captSqr]; // for now this is the replacement victim f->newEval = f->pstEval; f->newKey = f->hashKey; // start building new key and eval f->epSqr = 255;