comment
This commit is contained in:
parent
2918a33ca3
commit
b87c69bd17
@ -56,11 +56,10 @@ def part2(mx):
|
||||
path = find_path(graph, start, end)
|
||||
paths.append(path)
|
||||
except algorithm.NoPathError:
|
||||
#print('x', end='')
|
||||
# This 'a' is in a puddle of 'c's, so it's not pathable
|
||||
pass
|
||||
shortest = min(paths, key= lambda x: x.total_cost)
|
||||
matrix.apply_to_all(mx, lambda x: chr(x+ord('a')))
|
||||
matrix.apply_to_all(mx, lambda x: chr(x+ord('a'))) # Back to letters, single char prettier
|
||||
matrix.highlight(mx, red=shortest.nodes)
|
||||
print(shortest.total_cost)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user