From a9e589280c84fb42879f6b9272097b9cb2a3e91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 9 Dec 2020 10:14:01 +0100 Subject: skip total time for now Otherwise the entire table would need to be edited daily. --- 20/README | 22 +++++++++++----------- 20/py/aoc20.py | 20 ++++++++++++++------ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/20/README b/20/README index d023a37..6eaaf4c 100644 --- a/20/README +++ b/20/README @@ -1,18 +1,18 @@ Runtime: -------Part 1-------- -------Part 2-------- -Day Time Ans Time Ans Total time - 1 0.397 996996 3.149 9210402 3.547 - 2 0.824 591 0.757 335 5.128 - 3 1.915 209 2.237 1574890240 9.280 - 4 0.725 222 1.543 140 11.548 - 5 1.813 959 1.799 527 15.160 - 6 1.404 6714 3.717 3435 20.281 - 7 6.058 139 4.394 58175 30.733 - 8 0.254 2025 1.199 826 32.186 - 9 2.652 26796446 2.748 3353494 37.586 +Day Time Ans Time Ans + 1 0.348 996996 3.175 9210402 + 2 0.838 591 0.749 335 + 3 1.905 209 2.080 1574890240 + 4 0.715 222 1.585 140 + 5 1.660 959 1.708 527 + 6 1.346 6714 3.664 3435 + 7 2.884 139 2.681 58175 + 8 0.263 2025 1.193 826 + 9 2.741 26796446 2.875 3353494 --------- --------- -avg 1.783 2.394 +avg TBD TBD Stats: diff --git a/20/py/aoc20.py b/20/py/aoc20.py index 15a8782..ce63ee3 100644 --- a/20/py/aoc20.py +++ b/20/py/aoc20.py @@ -29,6 +29,7 @@ if __name__ == "__main__": only_part = 0 run_times = 1 input_root = "../input" + no_total = False argv, argc = sys.argv, len(sys.argv) i = 1 @@ -62,6 +63,9 @@ if __name__ == "__main__": i += 1 input_root = argv[i] i += 1 + elif argv[i] == "--no-total": + i += 1 + no_total = True else: print(f"unknown argument {argv[i]}") print(f"maybe try {argv[0]} --help ?") @@ -79,8 +83,10 @@ if __name__ == "__main__": print("Day", end="") print(" Time Ans ", end="") if only_part == 0: - print(" Time Ans ", end="") - print(" Total time") + print(" Time Ans", end="") + if not no_total: + print(" Total time", end="") + print() tot_time, tot_time_part = 0, [0, 0] runs = 0 @@ -89,7 +95,7 @@ if __name__ == "__main__": if day+1 in skip or (only and day+1 not in only): continue input = open(f"{input_root}/{day+1:02}").readlines() - print(f" {day+1:2} ", end="") + print(f" {day+1:2}", end="") for part, part_func in enumerate((mod.pt1, mod.pt2)): if not running_part(part+1): continue @@ -102,8 +108,10 @@ if __name__ == "__main__": avg_time = sum(times) / len(times) tot_time += avg_time tot_time_part[part] += avg_time - print(f"{avg_time*1000:6.3f} {ans:14} ", end="") - print(f"{tot_time*1000:8.3f}") + print(f" {avg_time*1000:6.3f} {ans:14}", end="") + if not no_total: + print(f" {tot_time*1000:8.3f}", end="") + print() runs += 1 print(" ---------", end="") @@ -114,7 +122,7 @@ if __name__ == "__main__": if running_part(1): print(f"{tot_time_part[0]*1000/runs:6.3f}", end="") if only_part == 0: - print(" ", end="") + print(" ", end="") if running_part(2): print(f"{tot_time_part[1]*1000/runs:6.3f}", end="") print() -- cgit v1.2.1