isAttackedByPawn([x, y], color) {
    // Attacked if an enemy pawn stands just behind an immediate obstacle:
    const adjacentSteps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
    for (let step of adjacentSteps) {
      const [i, j] = [x + step[0], y + step[1]];
      const [ii, jj] = [i + step[0], j + step[1]];
      if (
        V.OnBoard(ii, jj) &&
        this.board[i][j] != V.EMPTY &&
        this.board[ii][jj] != V.EMPTY &&
        this.getColor(ii, jj) == color &&
        this.getPiece(ii, jj) == V.PAWN &&
        !this.isImmobilized([ii, jj])
      ) {
        return true;
      }
    }
    return false;
  }
// isAttacked() is OK because the immobilizer doesn't take
isAttacked() is OK because the immobilizer doesn't take
isAttacked () is OK because the immobilizer doesn ' t take
isAttackedByPawn([x, y], color) {
    const adjacentSteps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
    for (let step of adjacentSteps) {
      const [i, j] = [x + step[0], y + step[1]];
      const [ii, jj] = [i + step[0], j + step[1]];
      if (
        V.OnBoard(ii, jj) &&
        this.board[i][j] != V.EMPTY &&
        this.board[ii][jj] != V.EMPTY &&
        this.getColor(ii, jj) == color &&
        this.getPiece(ii, jj) == V.PAWN &&
        !this.isImmobilized([ii, jj])
      ) {
        return true;
      }
    }
    return false;
  }
isAttackedByPawn ( [ x , y ] , color ) { const adjacentSteps = V . steps [ V . ROOK ] . concat ( V . steps [ V . BISHOP ] ) ; for ( let step of adjacentSteps ) { const [ i , j ] = [ x + step [ 0 ] , y + step [ 1 ] ] ; const [ ii , jj ] = [ i + step [ 0 ] , j + step [ 1 ] ] ; if ( V . OnBoard ( ii , jj ) && this . board [ i ] [ j ] != V . EMPTY && this . board [ ii ] [ jj ] != V . EMPTY && this . getColor ( ii , jj ) == color && this . getPiece ( ii , jj ) == V . PAWN && ! this . isImmobilized ( [ ii , jj ] ) ) { return true ; } } return false ; }
isAttacked() is OK because the immobilizer doesn't take
isAttacked () is OK because the immobilizer doesn ' t take
// Attacked if an enemy pawn stands just behind an immediate obstacle: