Are the rooms connected? You are locked in a massive fortress, slowly starving to death. Your guards inform you that there is food in the fortress, and even tell you where it is and provide a map of the building.
However, you are not sure that you can actually reach the food, given that the every door is locked, and every room is its own labyrinth. Are you able to reach the food? If you're in the same room, you should try. If you're not in the same room, then you might as well stay put, preserving your strength in case help from the outside world comes.
Input
Two arrays: 3 coordinates of where you are, and 3 coordinates of where the food is. (Both are 0-based)
:Optional: an array of three numbers, indicating the size of the following fortress in each dimension.
A three dimensional array of the fortress, where each point in the array is either 1/true (if that point is a wall) or 0/false (if the point is empty). The array is a rectangular prism, and there is no guarantee that the structure follows the laws of physics. (Thus, the bottom floor might be completely empty.)
The place where you are and the place where the food is both have a 0/false.
Output
Are the two points in the same room, unseparated by a wall? Note that you can not move through a diagonal.
Format
You may write a program or a function.
The input may be through STDIN, command line or function arguments, or reading from a file. If you choose a text-based input (like STDIN) you may use any delimiters to help your program parse the input.
The output may be through STDOUT or the function result. You can output/return &quot;true&quot;/&quot;false&quot;, 0/1, or the like.
Examples
In these examples, I put a Y where you are, and a F where the food is. This is just to help you understand the examples; in the actual input they would be 0/false.
Input
[0 0 1]      // You are at x = 0, y = 0, z = 1
[1 2 2]      // The food is at x = 1, y = 2, z = 2
[[[0 0 0]    // z = 0, y = 0
  [0 0 0]    // z = 0, y = 1
  [1 1 1]]   // z = 0, y = 2
 [[Y 0 0]
  [0 0 0]    // z = 1
  [1 1 1]]
 [[0 0 0]
  [1 1 0]    // z = 2
  [0 F 0]]]

Output
True. (The places are connected. You can move from [0 0 1] &gt; [2 0 1] &gt; [2 0 2] &gt; [2 2 2] &gt; [1 2 2].)
Input
[3 0 1]    
[1 1 0]
[4 2 2]         // If you want, you can include this in the input, to indicate the fortress's size
[[[0 1 0 0]     // z = 0, y = 0
  [0 F 1 0]]    // z = 0, y = 1
 [[0 0 1 Y]
  [0 1 0 0]]]

Output
False. (There are two rooms. Your room includes [2 0 0], [2 1 1], [3 0 0], [3 0 1], [3 0 1], and [3 1 1]. The food's room includes the other empty spaces. Note that a wall of 1's divides the fortress in half.
Winning criterion
Code golf. Shortest code for your function/program wins.
Python 2.x - 177 168 167 bytes

Basic flood fill to kick the game going. Requires the dungeon size.

f,(a,b,c),(w,h,d),p=input()
def l(x,y,z):
 if w&gt;x&gt;-1&lt;y&lt;h&gt;0&lt;=z&lt;d and p[z][y][x]&lt;1:p[z][y][x]=2;[(l(x+i,y,z),l(x,y+i,z),l(x,y,z+i))for i in-1,1]
l(*f)
print p[c][b][a]&gt;1


Examples:

Input:  [0,0,1],[1,2,2],[3,3,3],[[[0,0,0],[0,0,0],[1,1,1]],[[0,0,0],[0,0,0],[1,1,1]],[[0,0,0],[1,1,0],[0,0,0]]]
Output: True

Input:  [3,0,1],[1,1,0],[4,2,2],[[[0,1,0,0],[0,0,1,0]],[[0,0,1,0],[0,1,0,0]]]
Output: False


Ungolfed code:

(e,f,g),(a,b,c),(w,h,d),field=input()

def fill(x,y,z):
    if 0&lt;=x&lt;w and 0&lt;=y&lt;h and 0&lt;=z&lt;d and field[z][y][x]&lt;1:
        field[z][y][x]=2
        fill(x+1,y,z)
        fill(x-1,y,z)
        fill(x,y-1,z)
        fill(x,y+1,z)
        fill(x,y,z-1)
        fill(x,y,z+1)

fill(e,f,g)
print field[c][b][a]==2