Compare commits
3 Commits
b6512dc6c1
...
96f25dee8b
Author | SHA1 | Date |
---|---|---|
magical | 96f25dee8b | |
magical | 89b317c60d | |
magical | c9e55ade7d |
|
@ -0,0 +1,71 @@
|
|||
##################################################
|
||||
#....OOO.#.OO.O.#O..OO.......#...O..O..O....O....#
|
||||
#.O....O#.....#...O#.O..O.....OOO...O...##.OO..O.#
|
||||
#..OO#O..O...OO.OO.#.OO..OO....OOO..OO...OO#OO...#
|
||||
###O#O.OO.O.#.O.O...#.O.O...#OO......O.#OO....O..#
|
||||
#.O.OOO.........O.....OOO..O#O....#O........O.O..#
|
||||
#....O.OOO.O##O..O.OOO.O.....#....O....O....O.O#O#
|
||||
#OO...#O.O..O..OO...O..#.O.O....OO..O.O...OO..O#.#
|
||||
#O...O.#....................O...#..O.....O.OO...##
|
||||
#..O.O...#.#.OO.....OO...O.O...O.O...OO.O.OO...O##
|
||||
#.......O...O.....O..O...##..#O.#O.O.O..#......#O#
|
||||
#.O.......#.O.O...O..O........#..O.OO.O#.O......O#
|
||||
#OOO.O.#.O...O..O#O#.#..O.....O.#O...OO........O.#
|
||||
#O.#..O#.O.#OO.O...O.O....O....####.O.O.O.#.OO#..#
|
||||
#..#.O...#.#O.O.#OO...O.........#...........O.O..#
|
||||
#..#...O..O.##O#........#..OO.....O......O...#...#
|
||||
#..OO.O.O..#.O#O..#........#..O..OO#...O..#..#...#
|
||||
#.O......#..O....OO..#....##OO..#.OO#O#O..O....O.#
|
||||
#.....O.O...#O.O..OOO..#O...O.O...O.........OO#..#
|
||||
#.OO......O.#..#O.O.....#..O...O.OO.OO.#OO..O.#..#
|
||||
#..O.......OOOO.O#O..O.O.#.O.#.#O.OO.O.O.#.OOO.O.#
|
||||
##.O...O.O.....O.O.OO...OO...O..O..O....OO.O.O...#
|
||||
#..O..O..O.O.....O..#..OO..O.#.O.OOO..OO...O...OO#
|
||||
#.#.OOO.....OO..OOO..OO........O.O.OO......OO....#
|
||||
#.OO...O.OO..#O.#......#@.......#..OO.O......O.O.#
|
||||
#.OO...OO.O......OO#....O..O..O#...#O.#O..O......#
|
||||
#.O...O#.OO..O........OO...........#.O..O.O..#.#.#
|
||||
#....O..O.....OO...O.#..O..........OO..O.........#
|
||||
##.O..#O....O..O.......OO.#OO##O..OO.OOO.O..O.O..#
|
||||
#...OOOO.....OO..O....#..O...O#.O.O.O...O.O.O..O.#
|
||||
#.OO......O..#O..O....#....O...O.O#...#...OOO....#
|
||||
#...OO.O.O..OO..O#..#.OO.O.O.O.O......O.O..O.OO..#
|
||||
#O.O........O.O...O......O#.#.O.O.O....#O..O.O...#
|
||||
#.....OO....#OO.OO......OOO..O...O...#..O.....OOO#
|
||||
#O.O..O....O..O...O......O........#..O.....#OO...#
|
||||
#O#O...O#.O..##....OOO.....O##.OO##...O...O.#...O#
|
||||
#.O....O.O....O.O..O.....OO#OO.OO.....OOOO.....O##
|
||||
#.O..OO..O#...O....OO.O...O..O.O....O#.....#.#...#
|
||||
#....O..O....O..O.O....#..##.O.O.........O.O..O.O#
|
||||
#.O..O......O...##...........O...##O..O.O.#......#
|
||||
#.##....O.#O...#......#..O#O..O.......O.O.....O.O#
|
||||
#.O.OO#.OO#O...O.#..O.......#..O..O...O..O#...O.O#
|
||||
#...O..#....O.O.#.........#..O.OO.O...O...#.OO...#
|
||||
##..#.O.O...OOO.OO..O..#..O.O.O..............O...#
|
||||
##O..O.O..O...#.OOO..O.O#........#.....OO....#OO.#
|
||||
#..#....#...OO..O....#.#..O...#.O...O............#
|
||||
#O..#OO.#.......O#.....O.....O.............O..#..#
|
||||
#O......OO.O....#O..O...O...O.OO...OOO.#.#OO#..#O#
|
||||
#.O#OO..O..O.O.#.O.O....OO.......O..............##
|
||||
##################################################
|
||||
|
||||
>v^<v<<>^<^v^v^>>^>>^^>>^>^^v<>>^v^<^>^<>v>>><vv<v<vv^>><v<<^>^<>>v<>^^^^^v^v^>>>>v><^<>><^^>><vv<v<v>><>v^^>v<<^>>>vv>><>><>>vv><<>^>^<<>>^^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<v<>^<<<><<v^<<><^^><v<><>v<<v><^<^vv>^<v<>v<><v>vvv^><^v>>>^v^vv^^<^><<<^^^>vv^<>>v>^>v<^^^^<>v>><^^^><v>v^v<v<vv>^^^<^v<^v>^<v>>^v>><<>vv>v<v^^v>>^^>^vvv^vvv<v<v^>^<<^<^^^<^v>^<^^<<^>^^>><v^^v>vv<<<>>v>v<>^<^<<^v<^>>>vv<<^v>^^>^vv^>><^<<^><^<>vv^^<<v>><><>^<^<v>>><v>><<^>^><><>>v^v^<^>v<vv
|
|
@ -0,0 +1,21 @@
|
|||
##########
|
||||
#..O..O.O#
|
||||
#......O.#
|
||||
#.OO..O.O#
|
||||
#..O@..O.#
|
||||
#O#..O...#
|
||||
#O..O..O.#
|
||||
#.OO.O.OO#
|
||||
#....O...#
|
||||
##########
|
||||
|
||||
<vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><<><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
|
||||
vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
|
||||
><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
|
||||
<<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^<vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
|
||||
^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>>^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
|
||||
^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><<<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
|
||||
>^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
|
||||
<><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
|
||||
^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
|
||||
v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v><^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<^
|
|
@ -0,0 +1,10 @@
|
|||
########
|
||||
#..O.O.#
|
||||
##@.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
<^^>>>vv<v>>v<<
|
|
@ -0,0 +1,159 @@
|
|||
Initial state:
|
||||
########
|
||||
#..O.O.#
|
||||
##<em>@</em>.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#..O.O.#
|
||||
##<em>@</em>.O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move ^:
|
||||
########
|
||||
#.<em>@</em>O.O.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move ^:
|
||||
########
|
||||
#.<em>@</em>O.O.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#..<em>@</em>OO.#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#...<em>@</em>OO#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#...<em>@</em>OO#
|
||||
##..O..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#......#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##..<em>@</em>..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##..<em>@</em>..#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.<em>@</em>...#
|
||||
#...O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#..<em>@</em>O..#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#...<em>@</em>O.#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move >:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#....<em>@</em>O#
|
||||
#.#.O..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move v:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#.O<em>@</em>.#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#O<em>@</em>..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
||||
|
||||
Move <:
|
||||
########
|
||||
#....OO#
|
||||
##.....#
|
||||
#.....O#
|
||||
#.#O<em>@</em>..#
|
||||
#...O..#
|
||||
#...O..#
|
||||
########
|
|
@ -0,0 +1,10 @@
|
|||
##########
|
||||
#.O.O.OOO#
|
||||
#........#
|
||||
#OO......#
|
||||
#OO<em>@</em>.....#
|
||||
#O#.....O#
|
||||
#O.....OO#
|
||||
#O.....OO#
|
||||
#OO....OO#
|
||||
##########
|
|
@ -0,0 +1,3 @@
|
|||
#######
|
||||
#...O..
|
||||
#......
|
|
@ -0,0 +1,134 @@
|
|||
|
||||
|
||||
def parse(file):
|
||||
map = []
|
||||
for line in file:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
break
|
||||
map.append(line)
|
||||
moves = ""
|
||||
for line in file:
|
||||
moves += line.strip().replace("<","<").replace(">",">")
|
||||
return map, moves
|
||||
|
||||
|
||||
def solve(file):
|
||||
map, moves = parse(file)
|
||||
map = [list(x) for x in map]
|
||||
for y,line in enumerate(map):
|
||||
if '@' in line:
|
||||
x = line.index('@')
|
||||
cur = x,y
|
||||
|
||||
print(moves)
|
||||
for m in moves:
|
||||
next, ok = move(map, cur, m)
|
||||
cur = next
|
||||
print(cur)
|
||||
t = 0
|
||||
for y,line in enumerate(map):
|
||||
for x,c in enumerate(line):
|
||||
if c == 'O':
|
||||
t += y*100 + x
|
||||
print("".join(line))
|
||||
print(t)
|
||||
|
||||
|
||||
def solve2(file):
|
||||
map, moves = parse(file)
|
||||
map2 = []
|
||||
for line in map:
|
||||
l2 = []
|
||||
for c in line:
|
||||
if c == '#': c = '##'
|
||||
elif c == 'O': c = '[]'
|
||||
elif c == '.': c = '..'
|
||||
elif c == '@': c = '@.'
|
||||
l2.extend(c)
|
||||
map2.append(l2)
|
||||
map = map2
|
||||
|
||||
for y,line in enumerate(map):
|
||||
if '@' in line:
|
||||
x = line.index('@')
|
||||
cur = x,y
|
||||
#print(show(map), cur)
|
||||
|
||||
#print(moves)
|
||||
for m in moves:
|
||||
#print(m)
|
||||
assert map[cur[1]][cur[0]] == '@'
|
||||
next, ok = move(map, cur, m)
|
||||
cur = next
|
||||
#print(cur)
|
||||
t = 0
|
||||
for y,line in enumerate(map):
|
||||
for x,c in enumerate(line):
|
||||
if c == '[':
|
||||
t += y*100 + x
|
||||
print("".join(line))
|
||||
print(t)
|
||||
|
||||
def move(map, cur, m):
|
||||
if m == 'v': d = (0,1)
|
||||
if m == '<': d = (-1,0)
|
||||
if m == '>': d = (1,0)
|
||||
if m == '^': d = (0,-1)
|
||||
|
||||
n = (cur[0]+d[0], cur[1]+d[1])
|
||||
c = map[n[1]][n[0]]
|
||||
if c == 'O':
|
||||
_, ok = move(map, n, m)
|
||||
if not ok:
|
||||
return cur, False
|
||||
elif c in "[]":
|
||||
if m in '<>':
|
||||
_, ok = move(map, n, m)
|
||||
if not ok:
|
||||
return cur, False
|
||||
else:
|
||||
blocks = set()
|
||||
ok = canpush(map, n, d, blocks)
|
||||
if not ok:
|
||||
return cur, False
|
||||
#print(blocks)
|
||||
#print("before push\n", show(map))
|
||||
for x,y in sorted(blocks, key=lambda a:( a[1]*-d[1],a[0])):
|
||||
map[y+d[1]][x+d[0]] = map[y][x]
|
||||
map[y][x] = '.'
|
||||
#print("after push\n", show(map))
|
||||
|
||||
elif c == '#':
|
||||
return cur, False
|
||||
|
||||
map[n[1]][n[0]] = map[cur[1]][cur[0]]
|
||||
map[cur[1]][cur[0]] = '.'
|
||||
return n, True
|
||||
|
||||
def show(map):
|
||||
return '\n'.join(''.join(x) for x in map)
|
||||
|
||||
def canpush(map, cur, d, blocks):
|
||||
if cur in blocks:
|
||||
return True
|
||||
c = map[cur[1]][cur[0]]
|
||||
if c == '.':
|
||||
return True
|
||||
if c not in '[]':
|
||||
return False
|
||||
blocks.add(cur)
|
||||
nx, ny = (cur[0]+d[0], cur[1]+d[1])
|
||||
if c == '[':
|
||||
blocks.add((cur[0]+1, cur[1]))
|
||||
nx2 = nx+1
|
||||
else:
|
||||
blocks.add((cur[0]-1, cur[1]))
|
||||
nx2 = nx-1
|
||||
return canpush(map, (nx,ny), d, blocks) and canpush(map, (nx2,ny), d, blocks)
|
||||
|
||||
solve(open("sample1.in"))
|
||||
solve(open("sample2.in"))
|
||||
solve2(open('sample1.in'))
|
||||
solve(open("input"))
|
||||
solve2(open('input'))
|
|
@ -0,0 +1,112 @@
|
|||
from heapq import heappush, heappop
|
||||
|
||||
def search(start, is_goal, neighbors, heuristic=None, worst=None):
|
||||
if heuristic == None:
|
||||
def heuristic(x):
|
||||
return 0
|
||||
if not callable(is_goal):
|
||||
goal = is_goal
|
||||
def is_goal(this):
|
||||
return this == goal
|
||||
if not isinstance(start, list):
|
||||
start = [start]
|
||||
i = 0 # tiebreaker
|
||||
q = []
|
||||
for s in start:
|
||||
i += 1
|
||||
heappush(q, (heuristic(s), i, s, None))
|
||||
done = {}
|
||||
if worst:
|
||||
best_worst = min(worst(s) for s in start)
|
||||
while q:
|
||||
z, _, this, prev = heappop(q)
|
||||
if this in done:
|
||||
z -= heuristic(this)
|
||||
if z == done[this][0]:
|
||||
done[this] = (z, done[this][1]+[prev])
|
||||
continue
|
||||
cost_so_far = z - heuristic(this)
|
||||
#print(this,z, cost_so_far)
|
||||
|
||||
done[this] = (cost_so_far, [prev])
|
||||
|
||||
if is_goal(this):
|
||||
print("astar: visited", len(done), "nodes")
|
||||
print("astar: pending", len(q), "nodes")
|
||||
# find all nodes on a best path
|
||||
Q = [this]
|
||||
path = set()
|
||||
while Q:
|
||||
n = Q.pop()
|
||||
if n not in path and n != None:
|
||||
path.add(n)
|
||||
Q.extend(done[n][1])
|
||||
return cost_so_far, this, path
|
||||
|
||||
for c, n in neighbors(this):
|
||||
c = cost_so_far + c
|
||||
if n not in done or c < done[n][0]:
|
||||
h = heuristic(n)
|
||||
if worst:
|
||||
if c+h > best_worst:
|
||||
# if the best possible cost for this node
|
||||
# is worse than the lowest worst-case cost we've seen
|
||||
# then don't even bother exploring it
|
||||
continue
|
||||
w = worst(n)
|
||||
if c+w < best_worst:
|
||||
best_worst = c+w
|
||||
i += 1
|
||||
heappush(q, (c+h, i, n, this))
|
||||
elif n in done:
|
||||
if c == done[n][0]:
|
||||
done[n] = (c, done[n][1]+[n])
|
||||
|
||||
return float('inf'), None, []
|
||||
|
||||
def test():
|
||||
data = [
|
||||
"aabqponm",
|
||||
"abcryxxl",
|
||||
"accszzxk",
|
||||
"acctuvwj",
|
||||
"abdefghi",
|
||||
]
|
||||
#data = [
|
||||
# "aabbaaba",
|
||||
# "abcbaaba",
|
||||
# "accabcbb",
|
||||
# "accbbbba",
|
||||
# "abbbabab",
|
||||
#]
|
||||
start = (0,0)
|
||||
goal = (5,2)
|
||||
|
||||
def get(x,y):
|
||||
return ord(data[y][x])
|
||||
|
||||
def neighbors(src):
|
||||
x,y = src
|
||||
here = get(x,y)
|
||||
n = []
|
||||
def push(x,y):
|
||||
if 0 <= y < len(data):
|
||||
if 0 <= x < len(data[y]):
|
||||
if get(x,y) <= here+1:
|
||||
n.append((1, (x,y)))
|
||||
push(x-1, y)
|
||||
push(x+1,y)
|
||||
push(x, y-1)
|
||||
push(x, y+1)
|
||||
return n
|
||||
|
||||
def heuristic(n):
|
||||
return abs(goal[0] - n[0]) + abs(goal[1] - n[1])
|
||||
|
||||
c, _, path = search(start, goal, neighbors, heuristic)
|
||||
print(*data, sep="\n")
|
||||
print(*path, sep="\n")
|
||||
assert c == 31, c
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
|
@ -0,0 +1,141 @@
|
|||
#############################################################################################################################################
|
||||
#.................#.....#.....#.............#...#.......#.....#.......#.#.........#...........#...#...............#........................E#
|
||||
###########.#######.#.#.#.###.#.###########.#.#.#.###.###.#.#.#.#.#.#.#.#.#####.#.###.#######.#.#.###.#########.#.###.###########.#.#####.#.#
|
||||
#.........#.#.......#...#.#...#...#...#...#.#.#.....#.#...#.#.#...#.#...#.#.#...#...#.#...#.....#...#.......#.........#.....#...#.#...#.#...#
|
||||
#.#######.#.#.#########.#.#.#####.#.#.###.#.#.#######.#.###.###.#.#.###.#.#.#.#####.#.#.#.#########.#.#####.#.#.#########.#.###.#.###.#.###.#
|
||||
#.......#.#.#.......#.#.#.#.#...#...#.........................#.#...#.#.#...#.#...#...#.#.....#...#.#.....#.#...#.........#.....#.#...#.#...#
|
||||
#.#####.#.#.#######.#.#.#.#.#.#.#######.#.#######.#.#.#######.#.#.###.#.###.#.#.#.#####.#.###.#.###.#####.#.#.#.#.#####.#####.###.#.#.#.#.#.#
|
||||
#.#.....#.........#...#...#...#.#.......................#.............................#.#.#...#.....#.....#.......................#.....#.#.#
|
||||
#.#.#######.###.#####.#.#######.#.#############.###.#####.#.#.#.#.#.#.###.###.#.#####.#.#.#.###.#########.#.###.#########.###.#.#.#####.#.###
|
||||
#.#.#.......#.........#...#.....#...#...........#.#.#...#.#.....................#...#.....#.#.#.....#...#.#.....#.......#...#...#.#.#...#...#
|
||||
#.#.#########.#.#######.#.#.#######.#.#######.#.#.#.#.#.#.#####.#.#######.#.###.#.#######.#.#.#####.#.#.###.###.#.#####.###.#.###.#.#.#####.#
|
||||
#.#.......#...#...........#.....#...#.#...#...#...#...#.#.......#.........#.....#.#.....#...#.....#...#.........#.#...#.#...#.....#.....#...#
|
||||
#.#######.#.###.###.#.#.#.#####.#####.#.#.#.#.#########.###.#####.#############.#.#.###.#.###.#####.###########.#.#.#.#.#####.#.###.#####.#.#
|
||||
#...#.....#.#.............#...#...........#.#.........#...#.#.......#...#.....#...#.#.#...#.#.......#.......#...#...#.#.......#.#...#.....#.#
|
||||
#####.#####.#.#.#.###.#.#.###.#############.#########.###.#.#.###.#.#.#.#.###.#####.#.###.#.#.###.###.#####.#.#.#####.#######.#.#####.#####.#
|
||||
#...#.....#.#.#.#.#...#.#...#...#...#...#...#.....#...#...#.#.#.#...#.#.#...#...#...#.#.........#.....#...#.....#.....#.....#.#.......#...#.#
|
||||
#.#.#####.#.###.#.#.###.###.#.###.#.#.#.#.###.###.#.###.###.#.#.#.###.#####.###.#.###.#.#########.#####.#.#.###.#.#########.#.#####.###.#.#.#
|
||||
#.#.......#.....#...#...#.....#...#...#.....#...#.#...#.#...#.#...#...#.....#.#...#...#.#.#.....#...#...#.#...#.#.#.......#.#...#...#...#.#.#
|
||||
#.#######.#######.###.###.#####.#####.#####.#.#.#####.#.#.###.#.###.###.#####.#####.#.#.#.#.###.#.#.#.###.#.#.#.#.#.#####.#.###.#####.###.###
|
||||
#...#...#.#.........#.....#.#...#.....#...#...#.....#...#.....#.......#.#.......#...#.#...#...#.#.#...#...#.#.#.#...#.#.......#.#...#.#.#...#
|
||||
#.#.#.#.#.#.###.###.#.#####.#.#####.###.#.#########.###########.#####.#.#.#####.#.###.#.###.#.#.#.#####.###.#.#######.#.#######.#.#.#.#.###.#
|
||||
#.#.#.#...#...#.#.#.#...#...#.#...#...#.#.#.......#...........#...#...#.#.....#...#...#.#...#...#.......#...#.......#...#.....#...#.#.....#.#
|
||||
#.#.#.#######.#.#.#.###.#.###.#.#.#####.#.#.#####.#########.#####.#.#.#.###.#.#.#######.#.###.#.#######.#.#.###.#####.###.###.#####.#####.#.#
|
||||
#.#.#.....#...#.#...#.#.#...#...#...#...#...#...#.....#...#.....#...#.#...#.#.#.#.......#.....#.#...#...#.#...#.#.....#.#...#.........#...#.#
|
||||
#.#.#####.###.#.#.###.#.###.#######.#.#####.###.#####.#.#.#####.###.#####.#.#.###.#.#####.###.#.#.#.###.#.###.#.#.#####.###.#####.#####.###.#
|
||||
#.#...#.#...#.#.#.....#...#.....#...#.....#.....#.......#.....#.....#.....#.#.....#.......#...#...#...#.#.....#...#...#...#.....#.#.....#.#.#
|
||||
#####.#.###.###.#.#.#.###.###.#.#.#.#####.###.#.###.#########.#.###.#.#####.#.#####.#######.#.#######.#######.#####.#.#.#.#####.#.#.#####.#.#
|
||||
#.....#...#.#...#...#...#.....#.#.#...#.#...#.#...#.......#...#.....#...#...#.#...#.#.....#.#...............#.#.#...#...#.#...............#.#
|
||||
#.#######.#.#.#########.#######.#.###.#.###.#.###.###.###.#.#######.###.#.###.#.#.#.#.#.#.#.#.#.###.#####.#.#.#.#.#.#####.#.#.###.###.#.###.#
|
||||
#.....#...#.........#.....#...#.#.#.......#...#.#.....#.#.#.......#.#...#.#.#...#.#.#.#.#...#.#...#.....#.....#.#.#.#.......#.#.....#.#.#...#
|
||||
#.#.#.#.###.#.#.#####.#####.#.#.#.#######.#####.#######.#.###.#.###.#.###.#.#.###.#.###.#.###.###.#.#.#########.#.#.#######.#.#######.#.#.#.#
|
||||
#...#.#...#.#.#.#.....#.....#...#...#.........#...#.....#...#.#.....#.#.#.#...#...#...#.#.#...#.#...#.......#...#.#.....#.#.#.#.......#.#.#.#
|
||||
###.#.###.#.#.#.#.#####.###########.###.#####.#.#.#.###.###.#.#.#####.#.#.#.###.#.###.#.###.###.###.###.#.#.###.#.#####.#.#.#.#.#######.#.###
|
||||
#...#...#...#.#.#.#.#...#...#...#...#...#.......#.#...#...#.#.#.....#.#.........#.#.#.#.#.........#.....#.......#.#.#...#.#.#.#.#.......#...#
|
||||
#.#.###.#.###.#.#.#.#.###.#.#.#.#.###.#.#.#######.#####.###.#.#######.###########.#.#.#.#.#######.#.###.#.#.#####.#.#.###.#.#.#.#.###.#####.#
|
||||
#.#.#...#...........#.#...#.#.#...#...#.#.#.#...#.......#...#...#.....#...#...#.....#.#...#...#...#...#.#.#.#.......#.#.....#.#...#...#.....#
|
||||
#.#.#.#####.#.#####.#.#.###.#.#####.#####.#.#.#.#########.#####.#.#####.#.#.#.#######.###.#.#.#.#####.###.#.#.#######.#######.#####.###.#####
|
||||
#...#.#...#.#...#.#.#.#...#.#.#...#.......#.#.#...........#...#.#.......#...#.#.........#.#.#.#.#.....#...#.#.#.#.....#.......#.....#...#...#
|
||||
###.#.#.#.#.###.#.#.#.###.#.#.###.#.#######.#.#############.###.#.###########.#.###.###.#.#.#.#.#.###.#.#####.#.#.###.#.#######.#####.###.#.#
|
||||
#...#...#.#.....#...#.....#.#...#.#...#.....#.........#.....#...#.#...#.....#.#...#...#.#.#.#.#...#...#...#.....#.#.#.#...#.....#...#.....#.#
|
||||
#.#.###.#.###.#####.#.#########.#.###.#.#############.#.###.#.#.#.#.#.#####.#.###.#.#.#.###.#.#.#########.#.#####.#.#.###.#.#.###.#.#######.#
|
||||
#.#.......#...#.....#.#.....#...#...............#...#.#.#...#.#.#.#.#.....#.#.#...#.#.#.....#.#.#.......#...#.....#...#...#.#.....#.........#
|
||||
###.###.###.###.###.#.#.###.#.###.#######.###.###.#.#.#.#####.#.#.#.#####.#.#.#.###.###.#.###.###.#####.#####.#####.###.###.#####.#####.#.###
|
||||
#...#.....#.#.....#.#.#.#...#.#...#...#...#...#...#...#.#.....#...#...#...#.#...#.#.....#.........#...#.......#.......#.....#...#.....#.#...#
|
||||
#.#.###.###.#.#####.#.#.#.###.#.###.###.###.###.#######.#.#####.#####.#.###.#####.#######.#.#######.#.###.#######.#####.#####.#.#####.#####.#
|
||||
#.#...#.....#.#.....#.#.#.....#.#...#...#.#...#...#.....#...#.#.......#.#.........#.#.....#.......#.#.#...#.....#.#...#.#.....#.....#.....#.#
|
||||
#.#.#.#.###.#.#.#####.#.###.#.#.#.###.###.###.#.#.###.#.###.#.#########.###.#####.#.#.###########.#.###.###.###.###.#.#.#####.#####.#.###.#.#
|
||||
#...#.....#.#.#.......#.#...#.#...#...#...#.#...#.#...#.#...#.........#...#.....#.#.#.#...#.....#.#.....#...#...#...#.#.....#.#.....#.#...#.#
|
||||
#.#.###.#.###.#########.#.#.#.###.#.###.#.#.#.###.#.#.###.###.#######.###.#####.#.#.#.#.#.###.#.#.#.#####.###.###.###.#####.#.###.#.#.#.###.#
|
||||
#...#...............#...#.#...#...#...#.#...#...#...#.#...#.....#...#...#.......#...#...#...#.....#...#...#.#.#.....#...#.#.#...#.#...#.#...#
|
||||
###.###.#########.###.###.#.###.#####.#.###.###.#####.#.###.###.#.#.#.###.#####.###########.#.#########.###.#.#####.###.#.#.#.#.#.#.###.#.###
|
||||
#.#.....#.....#.....#.#.#.#.#.#.........#.#...#.#.....#.#.#...#...#...#...#...#.#.........#.#.#.......#.#...........#...#...#.....#.....#...#
|
||||
#.#####.#.###.#.###.#.#.#.#.#.#####.#####.###.#.#.#####.#.###.#######.#.###.#.###.#######.#.#.#####.#.#.#############.###.#####.#.#.###.###.#
|
||||
#.....#.#.#...#.#.#...#.#...#.....#.#.#.......#.#.#...#.#...#.#.....#...#...#...#.....#...#.#.......#...#.........#.............#.#...#.#...#
|
||||
#.###.#.#.#.###.#.#####.#####.#####.#.#.#######.#.#.#.#.#.#.#.###.#.#####.#.###.#.###.#.###.#.#########.#.###.#.###.#####.#####.#.#.#.###.#.#
|
||||
#...#.#.#.#.....#.....#...............#.#.......#...#.#.#.#.#.....#...#.........#.#...#.#...#.#.....#...#...#.#.........#.#.....#.....#...#.#
|
||||
###.#.#.#.#######.#####.###############.###.#.#######.#.###.#.###.#####.###.#####.#.###.###.#.#.###.###.###.#.#.#.###.#.###.###.#####.#.###.#
|
||||
#.#.#...#.#...........#.....#...#.#.....#...#.......#.#...#.......#...#...#.#.#...#...#.....#.#.#...#...#...#.........#.#...#.#...#...#...#.#
|
||||
#.#.###.#.#####.#####.#####.#.#.#.#.#####.#########.#.###.#########.#.###.#.#.#.#####.#########.#.###.#.#.###.#########.#.###.#.#.###.###.###
|
||||
#.#...#.#.#...#.....#...#.#...#...#...#.....#.....#...#.#...........#.......#.......#...#...#...#...#.#.....#.#.....#.....#.....#...#.#.#...#
|
||||
#.###.#.#.#.#.#######.#.#.#####.#####.#.###.#.#.#.#####.###################.#######.###.#.#.#.#.###.#.#######.#.###.#####.#.###.###.#.#.###.#
|
||||
#.......#...#.....#...#...#.....#...#.#...#...#.#.#.............#.........#...#...#.#.#...#.....#...#...#...#.....#.....#...#...#...#...#...#
|
||||
#.#####.#########.#.#######.#####.#.#.###.#####.#.#########.#.###.#.#####.###.###.#.#.###########.###.#.#.#.###########.#.###.#.#.###.###.#.#
|
||||
#.....#.#.......#.#.........#.....#.#...#.#.....#...........#.#...#.#...#...#...#.#...#.......#...#.....#.#.....#.......#...#...............#
|
||||
#.#.###.#.#.###.#.###########.#####.###.#.#.###################.###.#.#.###.###.#.###.###.###.#.#.#.#####.#.#.#.#.#########.#.#####.#.#.#####
|
||||
#.#.....#.......#.....#...........#.....#.#.....#.....#.......#.#...#.#...#...#.#.....#...#...#.#.#.#...#.#.#.#...#.........#.#.....#.......#
|
||||
#.#####.###.#.#######.#.###########.#.#########.#.###.#.#.#.#.#.#####.#.#.###.#.#.#####.#.###.#.###.#.#.#.#.#.#####.#.#######.#.#####.###.#.#
|
||||
#...#.......#.#.....#.........#.....#.#.....#.....#.#...#...#...#...#.#.#...#.#.#.......#.#.........#.#...#...#.....#...#.....#.#.......#.#.#
|
||||
###.#.#######.#.#########.#.###.###.#.###.#.#.#.#.#.#.#########.#.#.#.#.###.#.#.#####.#.###.#.###.###.#########.#######.#.#####.#.###.#.#.#.#
|
||||
#.#...#...#...#.......#...#...#...#.#.....#.....#.#...#.......#.#.#.#.#.....#...#.....#...#.#.#...#.#.#.................#.#.....#.#...#.#.#.#
|
||||
#.#####.#.#.#########.#.#####.#.#.#.###.#######.#.#####.#####.###.#.#.###.#######.###.#.#.#.###.###.#.#######.#####.###.#.#.#####.#.#.#.#.#.#
|
||||
#.......#.#.#.......#.#.#.....#.#.#.#...#.....#.#.....#.....#...#.#...#.#.#.....#.#.#...#...#.......#.......#.#...#.....#.#.....#.#...#...#.#
|
||||
#.#####.#.#.#.#####.#.#.#.###.#.#.#.#.###.###.#.#####.#.#.#.###.#.###.#.#.###.#.#.#.#.###.###.#.#.#.#######.###.#.#.#.###.#####.#.###.###.#.#
|
||||
#.#.......#...#.#...#...#.#...#.#.....#...#.#.#...#...#.#.#.#.....#...#.#...#...#.#.#.#...#...#...#.......#...#.#.#.#.......#...#...#...#.#.#
|
||||
#.#####.#######.#.###.#.#.#.#.#.#.###.#.###.#.#####.#.#.###.#.#########.###.#.###.#.#.#####.#####.#.#.#.#.###.#.#.#########.#.#####.#.#.#.#.#
|
||||
#...........#.#...#...#...#...#...#.....#...#...#...#.#...#.....#.......#.#.#.....#.#.......#.....#.#.#.....#.........#...#.#.....#...#...#.#
|
||||
#####.#.#.#.#.#.#######.#####.#.#.#.#######.###.#.#.#####.#######.#######.#.###.###.###########.###.#.#####.#########.#.#.#.#####.###.#.#.#.#
|
||||
#...#...#.#...#.....#...#...#.#.#.#.#.........#.....#...#.......#.....#...#...#.#...........#...#.#.#...#...........#...#.#.#.......#...#...#
|
||||
#.#.###.#.#########.#.###.#.#.#.#.#.###.#####.#.###.#.#.#######.#####.#.#####.#.#.###.#####.#.###.#.#####.#########.#####.#.#.#######.###.#.#
|
||||
#.#...#.#.........#.#...#.#.#.#...#...#.....#.......#.#.#.....#.....#.#.#.....#.#.#...#...#...#...........#.......#.#.....#...............#.#
|
||||
#.###.#.#########.#.###.#.###.#.#####.#####.#.#####.#.#.#.#.#####.#.#.#.#.#####.###.###.#.#.###############.#####.#.#.#########.###.###.#.###
|
||||
#...#.#.....#.....#.....#.#.........#.....#.#.#...#.#.#.#.#.......#...#...#.#...#...#...#.#.#.............#.....#...#.........#...#.....#...#
|
||||
#.#.#.#.###.#.###.#######.#.###.###.#####.#.#.#.#.###.#.#.#######.#####.###.#.###.#####.###.#.###########.#.#####.###########.#.#######.#.#.#
|
||||
#.#.#.#.....#.#.#.#.......#.#.....#...#...#...#.#.....#...#.....#.....#.#...#.........#...#.#.#.....#.#...#.#...#.......#...#...#.....#...#.#
|
||||
###.#.#.#####.#.#.###.#.#.#.#########.#.#######.###########.#.#######.#.###.#####.#.#.###.#.#.#.#.#.#.#.#####.#.#####.###.#.###.#.###.###.#.#
|
||||
#...#.......#.#.#.#...#.#.#.......#...#.........#.........#.#.......#.....#.......#.....#...#.#.#.#.#.#.#.....#...#...#...#...#.#.#.#.....#.#
|
||||
#.#########.#.#.#.#.#.#.#.#######.#.#############.#####.###.#####.###.###.#########.###.#####.###.#.#.#.###.#####.###.#.#####.###.#.#####.#.#
|
||||
#...#.....#.#.#...#.#...#.....#...#.#...........#.#.....#...#...#...#...#...#.......#.........#...#...#.#...#.......#.#.#...#.....#.....#.#.#
|
||||
#.#.#####.#.#.#.###.###.#####.#.###.#.#######.#.#.#.#####.###.#.###.###.###.#.#################.###.###.#.#.#######.#.#.#.###.#####.###.#.#.#
|
||||
#.#.....#...#.#...#...#.#...#.........#.......#.#.#.....#...#.....#...#...#.................#.....#.#...#.#.#.....#.#.#.#.....#...#...#.#.#.#
|
||||
#####.#.###.#.###.###.#.#.###.###.#####.#######.###.###.###.#.#######.#.#.#.#.#############.#####.#.#.###.###.###.#.###.###.###.#.###.#.#.#.#
|
||||
#...#.#...#...#.......#.#.#.....#...#...#.....#...#.#.#...#.#.#.....#.#.#.#.#...#.....#...#.#.....#.#.#.#.....#...#...#...#.#.#.#.#...#.#.#.#
|
||||
#.#.#####.###.#########.#.#.###.###.#.###.###.###.#.#.#.#.#.#.#.###.#.#.###.###.#.#.#.#.###.#.#####.#.#.#.#####.#####.###.#.#.#.#.#.#.#.#.#.#
|
||||
#.#.......#...#.........#.#.....#.#...#.....#.#...#...#...#.#.#.#.#...#...#...#.#...#...#...#.#...#.#.#...#...#.#...#...#.#...#.#...#.#.#.#.#
|
||||
#.#######.#####.#########.#.#.###.#####.###.###.#######.###.#.#.#.###.###.###.#.###.###.#.###.#.#.###.#####.#.#.#.#.###.#.#####.###.###.#.#.#
|
||||
#.#...#...#.....#.........#.#.....#...#...#.#...#.....#...#.#.#.......#.....#.#.........#.#.....#...#.......#.#.#.#.#...#.#.....#.#...#.....#
|
||||
#.#.#.#####.#####.#.#.#####.#####.#.###.###.#.###.###.#.#.#.#.#.#.#####.#.#.#.#####.#####.#########.#########.#.###.#.###.#.###.#.###.###.#.#
|
||||
#.#.#.#.....#...#...#.#.....#.....#.#...#...#.#...#.#.#.#.....#.#.#.....#.#.#.#.#...#...#.#.......#.........#.#.......#...#...#.....#...#...#
|
||||
#.#.#.#.#####.#.#.#.#.#.#####.#####.#.###.###.#.###.#.###.#####.#.#.###.#.###.#.#.###.#.#.#.#####.#######.#.#.#.#.###.#.#.###.#.#.#####.#.###
|
||||
#...#.#.......#.#.#.#.#.#.........#.....#...#.#...#.#...#...#.....#...#.#.....#.....#.#.#.....#...#.......#.#.#.#...#.#.#.......#.#.....#.#.#
|
||||
#.###.#.#######.#.#.###.#########.#.#######.#.###.#.###.#####.###.###.#.#######.#####.#.#.#####.###.#########.#####.#.#.###.###.#.#.#####.#.#
|
||||
#.#.#.............#...#...#.....#.#...#...#.#.....#...#.......#...#...#.#...#...#.....#.#.#.....#.............#.....#...#.....#...#...#.#.#.#
|
||||
#.#.#########.#.#.###.###.#.###.#.###.#.#.#.#########.#########.###.###.#.#.#.###.#####.###.#####.###########.#.###############.#.###.#.#.#.#
|
||||
#.....#...#...#.#...#...#...#.#.#...#.#.#.......#.......#.#.....#.#.#...#.#...#...#...#...#.......#...........#...#.............#...........#
|
||||
#####.#.#.#.###.#####.#######.#.###.###.#######.###.###.#.#.#####.#.#.###.###.#.#####.#.#.#.#####.#.#######.#.###.#.#########.#.#.#.#.#.#.#.#
|
||||
#.....#...#.#.......#.........#...#.....#.....#...#.#...#.#.....#...#.........#.....#...#.#.....#.#.#.......#...#.#.#.......#.......#.#...#.#
|
||||
#.#######.#.#.#####.###.###.#####.#######.#.#####.#.###.#.#####.#.#########.#####.#.###.#.###.#.###.#.#########.#.#.#.#####.#.#######.#.#.#.#
|
||||
#.#.....#.#...#...#...#.#...#.....#...#...#.#.....#...#...#.....#.#.......#.....#.#.#...#...#.#.....#.....#...#...#...#...#.................#
|
||||
#.#.###.#.#####.#.#.#.#.#.###.###.#.###.#.#.#.#####.#.#####.#####.###.#.###.###.###.#.###.#.#.#######.###.#.#.#.#######.#.#.###.#.#######.#.#
|
||||
#...#.....#...#.#...#...#.......#.....#.#.#.#.#.....#.#...#.#...#...#...#...#.#...#.#.....#.#.#.....#.#.#.#.#...#.......#.#.........#.......#
|
||||
#.#######.#.#.#.###.###.#####.#.#####.#.#.###.#######.#.#.#.#.#.###.###.#.###.###.#.#.###.#.###.###.#.#.#.#.#####.#.#########.#.#.#.#.#######
|
||||
#.#.....#.#.#.#.#.#...#.#...#.#.....#...#.....#.......#.....#.#.#...........#...#...#.#...#.....#.#.#...#.#.....#.#.........#.#.#.#.#.#.....#
|
||||
#.#.###.#.#.#.#.#.###.#.#.#.#######.#.#######.#.###.###.#####.#.#######.###.###.#####.#.#########.#.###.#.#######.#######.###.#.#.#.#.#.###.#
|
||||
#.#.#.......#...#...#.....#.......#.#...#...#...#...#...#.....#.....#...#...#.......#.#.........#...#...#.....#...#.....#.#...#.#.#.#.#.#...#
|
||||
###.#####.#########.#############.#.#####.#.#####.###.###.#.#######.#####.###.#####.#.#####.###.#.#####.#####.#.#######.#.#.###.#.#.#.###.#.#
|
||||
#...#.............#.....#.........#...#...#...#.....#...#.#.#.............#.....#...#.#.#...#...#.....#.....#.......#...#...#...#.#.......#.#
|
||||
#.###.###########.###.#.#.###########.#.###.#.#########.#.#.#.###.###.#####.###.#####.#.#.###.#######.#############.#.#.#####.#.#.#.#######.#
|
||||
#...#.#.....#...#...#.#...............#.#...#.........#.#.#...#...#.....#.#...#...#...#.#.#.........#...........#.#.#.#...#...#.#.#.#...#.#.#
|
||||
#.#.#.#.#.#.###.###.#.#####.#####.###.#.#.#.#########.#.#######.#.#.###.#.###.###.#.###.#.#####.#.#.#####.#####.#.#.#.###.#####.#.###.#.#.#.#
|
||||
#.....#.#.#...#.#...#...#.........#.....#.#.......#.#...........#.#.#.#.#.......#...#...#.....#.#.#.#.....#.....#.#...#.#.#...#.#.#...#.#.#.#
|
||||
#.#######.###.#.#.###.#.###.#####.#.###########.#.#.#####.###.#.###.#.#.#.#.###.#####.#.#####.#.#.#.###.#.#.#####.#####.#.#.#.#.#.#.###.#.#.#
|
||||
#.........#.#...#...#.......#.....#.#.........#.#.......#...#.........#.#.#...#...#...#...#...#.#.#.....#.#.....#...........#...#...#.#.#.#.#
|
||||
###########.#.#.###.#.#########.###.#.#.#####.#.#######.###.#.#########.#.###.###.###.#####.#.#.#.#######.#####.###############.#####.#.#.#.#
|
||||
#.....#.......#...#.#...#.......#...#.#.#...#...#.....#.....#.#.........#.......#.....#.....#.#.#.....#.#.....#...........#...#...#...#.#.#.#
|
||||
#.#.#.#.#.###.###.#.###.#.#####.#.#####.#.#######.###.#######.#.###############.#####.#.#######.#####.#.###.#############.###.#.#.#.###.#.#.#
|
||||
#.#.#.#.#.........#.#...#...#...#.#.....#.......#...#.#.....#.#.....#.....#.......#...#...#.....#.#...#.....#.........#...#.....#...#...#...#
|
||||
#.#.#.#.#####.#####.#####.###.#.#.#.#####.###.###.#.#.#####.#.#####.#.###.#.#.#####.#####.#.###.#.#.###.#####.#.#######.#.#.#######.#.#####.#
|
||||
#.#...#.#.#.....#...#.....#...#.#...#.......#.....#.#.......#.......#...#...#.#.....#...#...#.....#.#...#...#.#.........#.#.........#.#...#.#
|
||||
#.###.#.#.#.#.#.#.#.#.#####.#############.#########.#.#####.###########.#####.#.#######.#########.#.###.#.#.#.###########.#.#########.#.#.#.#
|
||||
#...#.#...#...#...#.#...#.#.............#.#.........#.#...#.#...#.......#.#...#.#.....#.........#.#...#.#.#...#.......#...#...#.....#.#.#.#.#
|
||||
###.#.#.#.###.#########.#.#######.#####.###.#########.#.#.#.#.#.#.#######.#.###.#.###.#.#######.#.###.#.#.#####.#####.#.#.###.#####.#.#.#.###
|
||||
#.#.#...#...#...........#...#.....#...#...#.#.#.....#.#.#.#.#.#.#...#.........#...#...#.......#.....#.#.#...#...#...#.......................#
|
||||
#.#.#.#.###.#.#.###########.#.###.#.#.###.#.#.#.###.#.#.#.#.#.#.###.#########.#####.#####.###.#####.#.#####.#.#####.#.#.#.#.#.#.###.#.#.###.#
|
||||
#.#.#.....#...#.....................#...#...#.....#...#.#.#...#.....#.....#.#...#.#.#...#...#.....#.#.....#...#.....#.#.#.#.#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#####.#.#.#######.#####.#.###.###.###.#######.###.#.#######.###.###.#.###.#.#.#.#.###.#.###.#.#####.#####.#.###.#.#.#.#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#...#.#...#...#.....#.#.#.#.#...#.#.....#.#...#.#...#...#...#...#.......#...#.#.......#.#...#...#...#.#.....#...#.....#...#.....#.#
|
||||
#.#.#.#.#.#.#.###.#.#.#.#.#####.#.#.#.###.###.###.###.###.#.#.#.###.###.#######.#######.#.###.###.#.###.###.#.#.#############.###########.#.#
|
||||
#.#.#...#...#.....#...#.#.#...#.............#.#.#...#.#.#.#.#.....#.#.#.......#.#.....#.#...............#...#.#.#.....#.....#.#.........#.#.#
|
||||
#.#.#.###.#.#.#########.#.#.#.#####.#.#.###.#.#.###.#.#.#.#########.#.#######.###.###.#.#####.#.#.#.#.###.###.#.#.###.#.###.###.#######.###.#
|
||||
#S............#.........#...#.........#...#.......#.....#.....................................#...#.#.......#.....#.....#.......#...........#
|
||||
#############################################################################################################################################
|
|
@ -0,0 +1,15 @@
|
|||
###############
|
||||
#.......#....E#
|
||||
#.#.###.#.###.#
|
||||
#.....#.#...#.#
|
||||
#.###.#####.#.#
|
||||
#.#.#.......#.#
|
||||
#.#.#####.###.#
|
||||
#...........#.#
|
||||
###.#.#####.#.#
|
||||
#...#.....#.#.#
|
||||
#.#.#.###.#.#.#
|
||||
#.....#...#.#.#
|
||||
#.###.#.#.#.#.#
|
||||
#S..#.....#...#
|
||||
###############
|
|
@ -0,0 +1,17 @@
|
|||
#################
|
||||
#...#...#...#..E#
|
||||
#.#.#.#.#.#.#.#.#
|
||||
#.#.#.#...#...#.#
|
||||
#.#.#.#.###.#.#.#
|
||||
#...#.#.#.....#.#
|
||||
#.#.#.#.#.#####.#
|
||||
#.#...#.#.#.....#
|
||||
#.#.#####.#.###.#
|
||||
#.#.#.......#...#
|
||||
#.#.###.#####.###
|
||||
#.#.#...#.....#.#
|
||||
#.#.#.#####.###.#
|
||||
#.#.#.........#.#
|
||||
#.#.#.#########.#
|
||||
#S#.............#
|
||||
#################
|
|
@ -0,0 +1,44 @@
|
|||
import astar
|
||||
|
||||
|
||||
def solve(file):
|
||||
map = [line.strip() for line in file]
|
||||
for y in range(len(map)):
|
||||
for x,c in enumerate(map[y]):
|
||||
if c == 'S':
|
||||
start = (x,y,'>')
|
||||
elif c == 'E':
|
||||
end = (x,y)
|
||||
|
||||
def isgoal(n):
|
||||
x,y,_ = n
|
||||
#print("isgoal", n)
|
||||
return (x,y) == end
|
||||
|
||||
def get(x,y):
|
||||
return map[y][x]
|
||||
|
||||
print(map)
|
||||
print(start, end)
|
||||
|
||||
def neighbors(src):
|
||||
x,y,dir = src
|
||||
n = []
|
||||
def push(x,y, newdir):
|
||||
if 0 <= y < len(map):
|
||||
if 0 <= x < len(map[y]):
|
||||
if get(x,y) != '#':
|
||||
cost = 1 if dir == '.' or newdir == dir else 1001
|
||||
n.append((cost, (x,y,newdir)))
|
||||
push(x-1, y, '<')
|
||||
push(x+1,y, '>')
|
||||
push(x, y-1, '^')
|
||||
push(x, y+1, 'v')
|
||||
return n
|
||||
|
||||
cost, _, nodes = astar.search(start, isgoal, neighbors)
|
||||
print(cost)
|
||||
print(len(set((x,y) for x,y,_ in nodes)))
|
||||
|
||||
solve(open('sample1.in'))
|
||||
solve(open('input'))
|
Loading…
Reference in New Issue