summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--19/py/d20.py10
-rw-r--r--19/py/d22.py6
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