Group demotions with non-captures
authorH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 12 Apr 2018 13:22:04 +0000 (15:22 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 12 Apr 2018 21:15:09 +0000 (23:15 +0200)
Promotions in Kyoto Shogi are not moves that deserve to be treated as
captures. This would search basically all moves in QS, and would hardly
sort any moves by history. Now that demotions are treated as non-captures
QS search explosion is much less of a problem.

dropper.c

index ee8bc83..24a1e62 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -941,7 +941,8 @@ MoveGen (int stm, MoveStack *m, int castle)
                        moveStack[slot] = move | from << 8 | to;
                    }
                    if(promote & stm) { // promotion is (also?) possible
-                       moveStack[--m->firstMove] = (move | from << 8 | to + 11) + (vVal[victim-WHITE] + 20 << 24); // put it amongst captures
+                       int slot = (promoDrops && !victim && piece&16 ? moveSP++ : --m->firstMove); // group demotions with non-captures
+                       moveStack[slot] = (move | from << 8 | to + 11) + (vVal[victim-WHITE] + 20 << 24); // put it amongst captures
                        if(!perpLoses) { // only for FIDE Pawns
                            moveStack[--m->firstMove] = move | from << 8 | to - 11 + (stm >> 6)*44; // turn previously-generated deferral into under-promotion
                            // other under-promotions could go here (Capahouse?)