- const color = this.turn;
- const validSteps = steps.filter(s => {
- const [i, j] = [x + s[0], y + s[1]];
- return (
- V.OnBoard(i, j) &&
- (this.board[i][j] == V.EMPTY || this.getColor(i, j) != color)
- );
- });
- if (validSteps.length == 0)
- // Can happen after mushroom jump
- return [x, y];