-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday19.py
More file actions
39 lines (25 loc) · 742 Bytes
/
day19.py
File metadata and controls
39 lines (25 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import os
top_dir = os.path.dirname(os.path.abspath(__file__)) + "/../../"
def get_xxx_from_line(string):
return string
def get_xxxs_from_lines(string):
return [get_xxx_from_line(l) for l in string.splitlines()]
def get_xxxs_from_file(file_path=top_dir + "resources/year2017_day19_input.txt"):
with open(file_path) as f:
return get_xxxs_from_lines(f.read())
def run_tests():
xxxs = get_xxxs_from_lines(
"""abc
def
ghi"""
)
def get_solutions():
xxxs = get_xxxs_from_file()
if __name__ == "__main__":
begin = datetime.datetime.now()
run_tests()
get_solutions()
end = datetime.datetime.now()
print(end - begin)