// Does m2 un-do m1 ? (to disallow undoing checkered moves)
oppositeMoves(m1, m2) {
return (
- m1 &&
+ !!m1 &&
m2.appear[0].c == "c" &&
m2.appear.length == 1 &&
m2.vanish.length == 1 &&
}
isAttackedByBishop(sq, colors) {
- return this.isAttackedBySlideNJump(sq, colors, V.BISHOP, V.steps[V.BISHOP]);
+ return this.isAttackedBySlideNJump(
+ sq, colors, V.BISHOP, V.steps[V.BISHOP]);
}
isAttackedByQueen(sq, colors) {
"c"
]);
let res = kingAttacked
- ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate!
+ ? [JSON.parse(JSON.stringify(this.kingPos[color]))]
: [];
this.turn = color;
return res;