欢迎.有人能解释一下这段代码会发生什么吗?我想知道这是如何工作的(它来自http://rosettacode.org/wiki/Maze_generation#Python).
from random import shuffle, randrange
def make_maze(w = 16, h = 8):
vis = [[0] * w + [1] for _ in range(h)] + [[1] * (w + 1)]
ver = [["| "] * w + ['|'] for _ in range(h)] + [[]]
hor = [["+--"] * w + ['+'] for _ in range(h + 1)]
def walk(x, y):
vis[y][x] = 1
d = [(x - 1, y), (x, y + 1), (x + 1, y), (x, …Run Code Online (Sandbox Code Playgroud)