// Squares of white and black king:
this.kingPos = { w: [-1, -1], b: [-1, -1] };
const fenRows = V.ParseFen(fen).position.split("/");
- const startRow = { 'w': V.size.x - 1, 'b': 0 };
for (let i = 0; i < fenRows.length; i++) {
let k = 0; //column index on board
for (let j = 0; j < fenRows[i].length; j++) {
let j = y + step[1];
while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) {
moves.push(this.getBasicMove([x, y], [i, j]));
- if (oneStep) continue outerLoop;
+ if (!!oneStep) continue outerLoop;
i += step[0];
j += step[1];
}
V.OnBoard(rx, ry) &&
this.board[rx][ry] != V.EMPTY &&
this.getPiece(rx, ry) == piece &&
- this.getColor(rx, ry) == color &&
- this.canTake([rx, ry], [x, y]) //for Paco-Sako (TODO: necessary?)
+ this.getColor(rx, ry) == color
) {
return true;
}