summaryrefslogtreecommitdiffstats
path: root/solutions/py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-16 20:49:09 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-16 20:50:09 +0100
commit58b64b16fcc0004eb8661d45ff3fbeef285d668a (patch)
tree463796e79243b8dc9e49b9e03374f7bce244d9f7 /solutions/py
parentb16f71eefe243089c69c9b9af956c66761fee170 (diff)
downloadaoc-58b64b16fcc0004eb8661d45ff3fbeef285d668a.tar.gz
Day 16 call from main
Runtime is ~12 seconds per part
Diffstat (limited to 'solutions/py')
-rw-r--r--solutions/py/d16.py23
-rw-r--r--solutions/py/main.py4
2 files changed, 12 insertions, 15 deletions
diff --git a/solutions/py/d16.py b/solutions/py/d16.py
index 01bb25e..d08c856 100644
--- a/solutions/py/d16.py
+++ b/solutions/py/d16.py
@@ -1,7 +1,3 @@
-from profilehooks import coverage
-from profilehooks import profile
-
-#@coverage
def do(input, phases=100, repeats=1):
nums = []
for i in range(repeats):
@@ -59,13 +55,12 @@ def square(size):
s += "\n"
return s
-input = open("../input/16", "r").readlines()
-ans1 = pt1(input)
-ans2 = pt2(input)
-print(ans1)
-print(ans2)
-#print(do(["80871224585914546619083218645595"]))
-#print()
-#print(square(8))
-#print(square(20))
-#print(square(62))
+if __name__ == "__main__":
+ input = open("../input/16", "r").readlines()
+ ans1 = pt1(input)
+ ans2 = pt2(input)
+ print(ans1)
+ print(ans2)
+ #print(square(8))
+ #print(square(20))
+ #print(square(62))
diff --git a/solutions/py/main.py b/solutions/py/main.py
index aa7a4e2..730c8ac 100644
--- a/solutions/py/main.py
+++ b/solutions/py/main.py
@@ -15,8 +15,10 @@ import d12
import d13
import d14
import d15
+import d16
-mods = [d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15]
+mods = [d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, \
+ d14, d15, d16]
timings = [[0 for _ in range(2)] for _ in range(len(mods))]
clock_type = time.CLOCK_MONOTONIC