Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Open Labyrinth by grazik
#Your code here
#You can import some modules or create additional functions
def check(z, map, poz): #z = y, x, string
#N
y = z[0]
x = z[1]
s = z[2]
if map[y - 1][x][0] == 0 and map[y - 1][x][1] == False:
poz.append([y - 1, x, s+'N'])
map[y - 1][x][1] = True
if map[y + 1][x][0] == 0 and map[y + 1][x][1] == False:
poz.append([y + 1, x, s+'S'])
map[y + 1][x][1] = True
if map[y][x - 1][0] == 0 and map[y][x - 1][1] == False:
poz.append([y, x - 1, s+'W'])
map[y][x - 1][1] = True
if map[y][x + 1][0] == 0 and map[y][x + 1][1] == False:
poz.append([y, x + 1, s+'E'])
map[y][x + 1][1] = True
def checkio(maze_map):
poz = []
for i in range(len(maze_map)):
for j in range(len(maze_map)):
maze_map[i][j] = [maze_map[i][j], False]
maze_map[1][1][1] = True
poz.append([1,1,''])
while len(poz) > 0:
if poz[0][1] == 10 and poz[0][0] == 10:
print (poz[0][2])
return poz[0][2]
check(poz[0], maze_map, poz)
poz.remove(poz[0])
return 'Blad'
Oct. 27, 2016