From c458c9fd50c572c3014524d361ca749883678206 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 10 Apr 2018 18:11:19 +0200 Subject: [PATCH] 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. --- dropper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; -- 1.7.0.4