- outerLoop:
- for (let step of adjacentSteps)
- {
- const [i,j] = [x+step[0],y+step[1]];
- if (V.OnBoard(i,j) && this.board[i][j] != V.EMPTY
- && this.getColor(i,j) == oppCol)
- {
- const oppPiece = this.getPiece(i,j);
- if (oppPiece == V.IMMOBILIZER)
- {
- // Moving is impossible only if this immobilizer is not neutralized
- for (let step2 of adjacentSteps)
- {
- const [i2,j2] = [i+step2[0],j+step2[1]];
- if (i2 == x && j2 == y)
- continue; //skip initial piece!
- if (V.OnBoard(i2,j2) && this.board[i2][j2] != V.EMPTY
- && this.getColor(i2,j2) == color)
- {
- if ([V.BISHOP,V.IMMOBILIZER].includes(this.getPiece(i2,j2)))
+ for (let step of adjacentSteps) {
+ const [i, j] = [x + step[0], y + step[1]];
+ if (
+ V.OnBoard(i, j) &&
+ this.board[i][j] != V.EMPTY &&
+ this.getColor(i, j) == oppCol
+ ) {
+ const oppPiece = this.getPiece(i, j);
+ if (oppPiece == V.IMMOBILIZER) {
+ // Moving is possible only if this immobilizer is neutralized
+ for (let step2 of adjacentSteps) {
+ const [i2, j2] = [i + step2[0], j + step2[1]];
+ if (i2 == x && j2 == y) continue; //skip initial piece!
+ if (
+ V.OnBoard(i2, j2) &&
+ this.board[i2][j2] != V.EMPTY &&
+ this.getColor(i2, j2) == color
+ ) {
+ if ([V.BISHOP, V.IMMOBILIZER].includes(this.getPiece(i2, j2)))