const c = this.turn;
const oppCol = this.getOppCol(c);
this.play(move)
- let res = this.isAttacked(this.kingPos[c], oppCol)
- || !this.isAttacked(this.antikingPos[c], oppCol);
+ let res = this.isAttacked(this.kingPos[c], [oppCol])
+ || !this.isAttacked(this.antikingPos[c], [oppCol]);
this.undo(move);
return res;
}
let res = super.getCheckSquares(move);
this.play(move);
const c = this.turn;
- if (!this.isAttacked(this.antikingPos[c], this.getOppCol(c)))
+ if (!this.isAttacked(this.antikingPos[c], [this.getOppCol(c)]))
res.push(JSON.parse(JSON.stringify(this.antikingPos[c])));
this.undo(move);
return res;
{
const color = this.turn;
const oppCol = this.getOppCol(color);
- if (!this.isAttacked(this.kingPos[color], oppCol)
- && this.isAttacked(this.antikingPos[color], oppCol))
+ if (!this.isAttacked(this.kingPos[color], [oppCol])
+ && this.isAttacked(this.antikingPos[color], [oppCol]))
{
return "1/2";
}