+ if (this.getPiece(x, y) == V.PAWN) {
+ // Promotions by captures can be reduced to only one deterministic
+ // move (because of the explosion).
+ moves = moves.filter(m => {
+ return (
+ m.vanish.length == 1 ||
+ [V.PAWN, V.QUEEN].includes(m.appear[0].p)
+ );
+ });
+ }
+