From f546d8a4e55ac046ecddb00e41e72f6e599446f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 23 Dec 2019 08:14:30 +0100 Subject: Cleanup --- 19/py/d20.py | 10 +--------- 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 -- cgit v1.2.1