return moves;
}
- // Long-leaper
getKnightCaptures(startSquare, byChameleon) {
// Look in every direction for captures
const steps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
return super.getPotentialQueenMoves(sq).concat(this.getKnightCaptures(sq));
}
+ // Chameleon
getPotentialBishopMoves([x, y]) {
let moves = super
.getPotentialQueenMoves([x, y])
return moves;
}
- // Withdrawer
addQueenCaptures(moves, byChameleon) {
if (moves.length == 0) return;
const [x, y] = [moves[0].start.x, moves[0].start.y];
});
}
+ // Withdrawer
getPotentialQueenMoves(sq) {
let moves = super.getPotentialQueenMoves(sq);
this.addQueenCaptures(moves);
} else if (move.appear[0].p == V.KING)
notation = "K" + (move.vanish.length > 1 ? "x" : "") + finalSquare;
else notation = move.appear[0].p.toUpperCase() + finalSquare;
- if (move.vanish.length > 1 && move.appear[0].p != V.KING) notation += "X"; //capture mark (not describing what is captured...)
+ // Add a capture mark (not describing what is captured...):
+ if (move.vanish.length > 1 && move.appear[0].p != V.KING) notation += "X";
return notation;
}
};