Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
5-liner: dab solution in Creative category for Open Labyrinth by przemyslaw.daniel
def checkio(data, x=1, y=1, out="", r=__import__('random').randint):
while not (x, y) == (10, 10):
d, a, b = [('S', x+1, y), ('N', x-1, y), ('W', x, y-1), ('E', x, y+1)][r(0, 3)]
if 0 <= a < 12 and 0 <= b < 12 and not data[a][b]: x, y, out = a, b, out+d
return out
March 31, 2017