generated from public/aoc_template
day16 - minor cleanups
This commit is contained in:
parent
b296e35b85
commit
060fd324b5
8
day16.py
8
day16.py
@ -54,7 +54,7 @@ def get_tiles_from_all_paths(grid: Grid) -> int:
|
||||
visited = {}
|
||||
while queue:
|
||||
score, pos, facing, path = heappop(queue)
|
||||
if pos in visited and score > visited[pos][0] + 1000:
|
||||
if pos in visited and score > visited[pos] + 1000:
|
||||
continue
|
||||
|
||||
if pos in path_scores and pos in visited:
|
||||
@ -62,11 +62,7 @@ def get_tiles_from_all_paths(grid: Grid) -> int:
|
||||
target_path |= path
|
||||
continue
|
||||
|
||||
visited[pos] = (score, facing)
|
||||
if pos == target:
|
||||
target_path |= path
|
||||
continue
|
||||
|
||||
visited[pos] = score
|
||||
if score >= target_score:
|
||||
continue
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user