Wooo Slate and tonyjv are really complex
Infact the pseudo of slate is flawless but will a newbie understand the algos.?
I just wrote this as a step by step to the solution. I real life, i advice you to use Slate's example.
labyrinth = \
[[0,0,0,0,0,0,1,0],
[0,1,0,1,1,1,1,0],
[0,1,1,1,0,1,0,0],
[0,1,0,0,0,0,0,0],
[0,1,1,0,1,1,1,0],
[0,0,1,1,1,0,0,0],
[0,1,1,0,1,1,1,0],
[0,1,0,0,0,0,0,0]]
de=0
for x in labyrinth:
for y in x:
de=de+1
if y == 0:
print '##',
else:
print ".",
if de == 8:
print '\n'
de=0
for fun ;)