}
canIplay(side, [x, y]) {
+ if (side != this.turn) return false;
if (this.subTurn == 0) return (x >= V.size.x);
const c = this.getColor(x, y);
return (
vanish: [
new PiPo({ x: rank, y: file, c: color, p: V.PAWN })
],
- start: { x: 8, y: y },
+ start: { x: 8 + (color == 'b' ? 1 : 0), y: y },
end: { x: rank, y: file }
});
}
this.play(moves[3]); //HACK... 3 = queen index
const res = this.getComputerMove();
this.undo(moves[3]);
+ if (Array.isArray(res)) return [moves[3]].concat(res);
return [moves[3], res];
}
// subTurn == 1 (necessarily)