diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-23 08:14:30 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-12-23 14:44:24 +0100 |
| commit | f546d8a4e55ac046ecddb00e41e72f6e599446f4 (patch) | |
| tree | 280a7e0af37ea4d5373d44980242e798ffc9b3d2 /19 | |
| parent | 8a8772b56d31ae92d120778129db04fb378043dc (diff) | |
| download | aoc-f546d8a4e55ac046ecddb00e41e72f6e599446f4.tar.gz | |
Cleanup
Diffstat (limited to '19')
| -rw-r--r-- | 19/py/d20.py | 10 | ||||
| -rw-r--r-- | 19/py/d22.py | 6 |
2 files changed, 2 insertions, 14 deletions
diff --git a/19/py/d20.py b/19/py/d20.py index 2a248ac..4fa5fc2 100644 --- a/19/py/d20.py +++ b/19/py/d20.py @@ -115,21 +115,13 @@ def pt1(input): print(draw(maze, around=p)) sys.exit() alone_portals[portal] = location - #print(draw(maze, start=start, end=end, portals=portal_pairs)) - - INSIDE_X_LO = 20 - INSIDE_X_HI = 120 - INSIDE_Y_LO = 20 - INSIDE_Y_HI = 100 # find shortest path between each portal (and start/end) h = [] visited = set(start) heap.heappush(h, (0, start)) while len(h) > 0: - cur = heap.heappop(h) - dist = cur[0] - point = cur[1] + dist, point = heap.heappop(h) x = point[0] y = point[1] if point == end: diff --git a/19/py/d22.py b/19/py/d22.py index b59d458..fe2da0e 100644 --- a/19/py/d22.py +++ b/19/py/d22.py @@ -4,11 +4,7 @@ def deal(deck): return deck[::-1] def cut(deck, n): - if n > 0: - return deck[n:] + deck[:n] - else: - n = abs(n) - return deck[-n:] + deck[:-n] + return deck[n:] + deck[:n] def deal_incr(deck, incr): pos = 0 |
