   3D array.  How do I find the outermost indices?
  If I create a 3D array of variable width, height and depth:   public void CreateNewLevel(int width, int height, int depth)   {  array3D = new int[width, height, depth];  for (int x = 0; x < width; ++x)  { for (int y = 0; y < height; ++y) {for (int z = 0; z < depth; ++z){    } }  }   }How can I find the outermost indices?Would it be something along the line of checking if x - 1 < 0 || y - 1 < 0 || z - 1 < 0x + 1 == width || y + 1 == height || z + 1 == depth?EDIT:Is this correct?   public void CreateNewLevel(int width, int height, int depth)   {  map3D = new int[width, height, depth];  for (int x = 0; x < width; ++x)  { for (int y = 0; y < height; ++y) {for (int z = 0; z < depth; ++z){    bool a = x == 0 || y == 0 || z == 0;    bool b = x + 1 == width || y + 1 == height || z + 1 == depth;    map3D[x, y, z] = a || b ? 1 : 0;} }  }   }or can anyone see any cases where it wouldn't work?   
  The extremities of the level are in the slices where x, y, or z is 0 or (size - 1). Is that what you want? The corners are in the intersections of these slices (logical AND).   