part 1
This commit is contained in:
commit
612fb5f38e
17
maze/__init__.py
Normal file
17
maze/__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
import random
|
||||
|
||||
|
||||
def make_maze(size=8):
|
||||
r = [[[0] * size] * size] * size
|
||||
for i in xrange(size):
|
||||
for j in xrange(size):
|
||||
r[i][j] = [random.randint(0, 1) for i in xrange(size)]
|
||||
r[0][0][0] = 1
|
||||
r[7][7][7] = 1
|
||||
return r
|
||||
|
||||
|
||||
def parse_maze(filename):
|
||||
f = open(filename, 'r')
|
||||
t = f.read()
|
||||
return [[int(j) for j in i.split()] for i in t.split('\n\n') if i]
|
72
samples/maze.txt
Normal file
72
samples/maze.txt
Normal file
@ -0,0 +1,72 @@
|
||||
1 0 0 0 1 0 0 0
|
||||
0 1 1 1 1 1 0 0
|
||||
0 1 0 1 1 0 0 0
|
||||
0 1 1 1 0 0 1 1
|
||||
1 1 0 0 0 1 0 0
|
||||
1 1 1 0 0 1 1 0
|
||||
1 0 1 0 0 1 0 1
|
||||
0 0 1 0 1 0 1 0
|
||||
|
||||
1 0 0 0 0 1 0 0
|
||||
1 1 0 0 0 1 0 1
|
||||
1 0 1 0 1 1 1 1
|
||||
0 0 0 0 1 0 0 1
|
||||
0 0 0 0 1 0 1 1
|
||||
0 0 0 1 0 0 1 0
|
||||
1 0 1 0 1 0 0 0
|
||||
0 1 0 1 1 0 0 1
|
||||
|
||||
1 1 1 0 0 0 0 1
|
||||
1 0 0 1 1 1 0 1
|
||||
1 0 0 1 1 0 1 0
|
||||
0 1 0 1 0 1 1 1
|
||||
1 0 1 1 1 1 0 0
|
||||
0 1 0 1 1 0 0 0
|
||||
1 1 0 1 0 0 0 1
|
||||
1 1 1 0 0 0 1 0
|
||||
|
||||
1 1 0 0 1 0 1 1
|
||||
1 1 1 1 1 0 0 1
|
||||
1 1 0 0 1 0 1 1
|
||||
0 1 1 1 1 1 0 1
|
||||
0 1 1 0 0 0 1 0
|
||||
0 1 0 1 0 0 0 0
|
||||
1 1 0 1 0 1 1 0
|
||||
0 0 0 0 1 1 1 0
|
||||
|
||||
1 0 0 0 1 1 1 0
|
||||
0 1 0 1 0 1 0 1
|
||||
1 0 0 1 0 0 0 0
|
||||
1 1 1 0 0 1 0 0
|
||||
0 1 1 0 0 0 1 0
|
||||
0 1 0 1 0 1 0 0
|
||||
1 0 0 1 1 1 0 1
|
||||
1 1 1 1 0 0 0 1
|
||||
|
||||
1 0 1 1 1 0 0 0
|
||||
0 0 0 1 0 0 1 0
|
||||
0 1 1 0 0 0 0 1
|
||||
0 0 0 1 0 0 0 1
|
||||
1 0 1 1 0 1 1 0
|
||||
1 0 1 0 1 1 0 1
|
||||
0 0 0 0 0 0 1 1
|
||||
1 1 0 0 1 0 0 0
|
||||
|
||||
0 0 0 0 0 0 1 1
|
||||
1 0 0 1 1 1 0 1
|
||||
0 1 0 1 1 1 1 1
|
||||
0 1 1 0 0 1 1 0
|
||||
1 1 1 0 1 1 1 1
|
||||
1 0 1 1 0 1 0 0
|
||||
0 0 0 1 0 0 1 0
|
||||
1 1 1 0 1 1 1 0
|
||||
|
||||
1 1 1 1 0 0 1 0
|
||||
0 0 1 0 0 1 0 1
|
||||
0 1 1 1 0 1 0 0
|
||||
1 1 1 0 1 0 0 1
|
||||
0 0 1 0 1 0 0 0
|
||||
1 1 1 1 0 1 0 1
|
||||
1 0 1 1 1 1 1 0
|
||||
1 0 0 0 1 1 1 1
|
||||
|
Loading…
Reference in New Issue
Block a user