- for (let dir of dirs)
- {
- const [i1,j1] = [x-dir[0],y-dir[1]]; //"before"
- const [i2,j2] = [x+dir[0],y+dir[1]]; //"after"
- if (V.OnBoard(i1,j1) && V.OnBoard(i2,j2))
- {
- if ((this.board[i1][j1]!=V.EMPTY && colors.includes(this.getColor(i1,j1))
- && this.board[i2][j2]==V.EMPTY)
- ||
- (this.board[i2][j2]!=V.EMPTY && colors.includes(this.getColor(i2,j2))
- && this.board[i1][j1]==V.EMPTY))
- {
+ for (let dir of dirs) {
+ const [i1, j1] = [x - dir[0], y - dir[1]]; //"before"
+ const [i2, j2] = [x + dir[0], y + dir[1]]; //"after"
+ if (V.OnBoard(i1, j1) && V.OnBoard(i2, j2)) {
+ if (
+ (this.board[i1][j1] != V.EMPTY &&
+ colors.includes(this.getColor(i1, j1)) &&
+ this.board[i2][j2] == V.EMPTY) ||
+ (this.board[i2][j2] != V.EMPTY &&
+ colors.includes(this.getColor(i2, j2)) &&
+ this.board[i1][j1] == V.EMPTY)
+ ) {