Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Open Labyrinth by nesterione
def checkio(maze_map):
dirs= [("S",1,0),("N",-1,0),("W",0,-1),("E",0,1)]
def move(maze_map, pY, pX, path):
maze_map[pY][pX] = 1
if pY == pX == 10:
return path
for dr in dirs:
if maze_map[pY+dr[1]][pX+dr[2]]==0:
a = move(maze_map,pY+dr[1], pX+dr[2], path+dr[0])
if a!=None:
return a
return None;
path = move(maze_map, 1, 1, "")
return path;
March 20, 2015
Comments: