private boolean reveal(int x, int y, int i, boolean top, boolean right, boolean bottom, boolean left, int iteration) {
    if (iteration > width || iteration > height) {
      return false;
    }
    if (inRange(x, y)) {
      data[x][y] = VISIBLE;
      if (i == 0 || obstacles[x][y]) {
        return false;
      }
      if (left) {
        left = reveal(x - 1, y, i - 1, top, false, bottom, left, iteration + 1);
      }
      if (right) {
        right = reveal(x + 1, y, i - 1, top, right, bottom, false, iteration + 1);
      }
      if (bottom) {
        bottom = reveal(x, y - 1, i - 1, false, right, bottom, left, iteration + 1);
      }
      if (top) {
        top = reveal(x, y + 1, i - 1, top, right, false, left, iteration + 1);
      }
      return true;
    }
    return false;
  }