I want to do random generation of levels using 2D arrays. 0 = emptiness, 1 = wall, how generate levels which have a passable route from a starting point to a finish(yellow circle, appears in a random free spot on the map) location?
pole = [[0] * 20 for i in range(20)]
for i in range(20):
for j in range(20):
pole[i][j] = random.randint(0, 1)
At the moment it just randomizes the ones and zeros and it comes out: