- if (moves.length == 0 && piece == V.BISHOP) {
- if (
- x == 0 && y == 0 &&
- this.board[1][1] != V.EMPTY &&
- this.board[2][2] == V.EMPTY
- ) {
- return [super.getBasicMove([x, y], [2, 2])];
- }
- if (
- x == 0 && y == 8 &&
- this.board[1][7] != V.EMPTY &&
- this.board[2][6] == V.EMPTY
- ) {
- return [super.getBasicMove([x, y], [2, 6])];
- }
- if (
- x == 8 && y == 0 &&
- this.board[7][1] != V.EMPTY &&
- this.board[6][2] == V.EMPTY
- ) {
- return [super.getBasicMove([x, y], [6, 2])];
- }
+ if (
+ moves.length == 0 && piece == V.BISHOP &&
+ [0, 8].includes(x) && [0, 8].includes(y)
+ ) {
+ const indX = x == 0 ? [1, 2] : [7, 6];
+ const indY = y == 0 ? [1, 2] : [7, 6];