// m.vanish.length >= 2, first capture gives direction
const ref = (Math.abs(m.vanish[1].x - m.start.x) == 1 ? m.start : m.end);
const step = [m.vanish[1].x - ref.x, m.vanish[1].y - ref.y];
// m.vanish.length >= 2, first capture gives direction
const ref = (Math.abs(m.vanish[1].x - m.start.x) == 1 ? m.start : m.end);
const step = [m.vanish[1].x - ref.x, m.vanish[1].y - ref.y];
- step[0] / Math.abs(step[0]),
- step[1] / Math.abs(step[1])
+ multStep * step[0] / Math.abs(step[0]),
+ multStep * step[1] / Math.abs(step[1])
const color = this.turn;
move.turn = color; //for undo
V.PlayOnBoard(this.board, move);
const color = this.turn;
move.turn = color; //for undo
V.PlayOnBoard(this.board, move);
captures.push({
square: move.start,
step: [move.end.x - move.start.x, move.end.y - move.start.y]
});
if (this.atLeastOneCapture())
// There could be other captures (optional)
captures.push({
square: move.start,
step: [move.end.x - move.start.x, move.end.y - move.start.y]
});
if (this.atLeastOneCapture())
// There could be other captures (optional)