From 831997571a05919f469fec7c3f10a53a45c58e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 18 Dec 2019 23:06:03 +0100 Subject: Add thoughts for d18 --- 19/py/d18.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '19/py') diff --git a/19/py/d18.py b/19/py/d18.py index 41ade0a..1b70c86 100644 --- a/19/py/d18.py +++ b/19/py/d18.py @@ -235,9 +235,9 @@ while True: neighbours = graph[last] for n in neighbours: - #TODO recognize cycles - #if n[0] in visited: - # continue + #TODO check if current state has been reached before and skip if it has + + # a state is (not really) a set of keys collected (:frozenset) and the current square if n[0].isupper() and n[0] not in unlocked: continue visited = visited.copy() -- cgit v1.2.1