From f6442664931bff2f37027a0d0eaf706017b5537d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 18 Dec 2019 20:42:42 +0100 Subject: More day 18 WIP --- 19/py/d18.png | Bin 0 -> 263667 bytes 19/py/d18.py | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 19/py/d18.png (limited to '19/py') diff --git a/19/py/d18.png b/19/py/d18.png new file mode 100644 index 0000000..23aa332 Binary files /dev/null and b/19/py/d18.png differ diff --git a/19/py/d18.py b/19/py/d18.py index 61a5cb0..41ade0a 100644 --- a/19/py/d18.py +++ b/19/py/d18.py @@ -220,6 +220,7 @@ for path, dist in start_paths.items(): m = 0 while True: + print(cur) cur = heap.heappop(h) dist = cur[0] last = cur[1] @@ -234,8 +235,9 @@ while True: neighbours = graph[last] for n in neighbours: - if n[0] in visited: - continue + #TODO recognize cycles + #if n[0] in visited: + # continue if n[0].isupper() and n[0] not in unlocked: continue visited = visited.copy() -- cgit v1.2.1