Skip to content

Commit c6e6881

Browse files
committed
Everybody Codes: tidy tmpl
1 parent 3a4aa96 commit c6e6881

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

everybody_codes/tmpl.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Everyone Codes Day N."""
22

33
import logging
4-
import time
54
from lib import helpers
65
from lib import parsers
76

@@ -22,14 +21,4 @@ def solve(part: int, data: str) -> int:
2221
]
2322

2423
if __name__ == "__main__":
25-
for _part, _data, expected in TESTS:
26-
assert solve(_part, PARSER.parse(_data)) == expected
27-
print("Tests pass.")
28-
day = int(__file__.split("_", maxsplit=-1)[-1].split(".")[0])
29-
for _part in range(1, 4):
30-
with open(f"inputs/{day:02}.{_part}.txt", encoding="utf-8") as f:
31-
_input = PARSER.parse(f.read()) # type: list[list[int]]
32-
start = time.perf_counter_ns()
33-
got = solve(_part, _input)
34-
end = time.perf_counter_ns()
35-
print(f"{day:02}.{_part} {got:15} {helpers.format_ns(end - start):8}")
24+
helpers.run_solution(globals())

0 commit comments

Comments
 (0)