}
// NOTE: canTake includes (wrong) captures of antiking,
- // to not go to low-level using findDestSquares()
+ // to detect attacks on antikings.
canTake([x1, y1], [x2, y2]) {
const piece1 = this.getPiece(x1, y1);
const color1 = this.getColor(x1, y1);
underCheck(square_s, color) {
let res = false;
- if (!Array.isArray(square_s[0]))
- square_s = [square_s];
square_s.forEach(sq => {
switch (this.getPiece(sq[0], sq[1])) {
case 'k':