Start boilerplate for day05

This commit is contained in:
Thom Dickson 2021-12-05 02:02:18 -05:00
parent dde27c2f46
commit b0449d8f9e
Signed by: boots
GPG Key ID: 40BE2AF8EBF8D2BB
2 changed files with 33 additions and 0 deletions

10
day05/day05.in Normal file
View File

@ -0,0 +1,10 @@
0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2

23
day05/day05.py Normal file
View File

@ -0,0 +1,23 @@
def ingest(input):
paths = []
for line in input:
print(line)
paths.append([[int(x) for x in point.split(",")] for point in
line.split(" -> ")])
return paths
def part1():
with open("day05.in", "r") as f:
paths = ingest([line.rstrip() for line in f])
print([[x[0][0], x[1][0]] for x in paths])
print(paths)
def main():
print("=== PART 1 ===")
part1()
if __name__ == "__main__":
main()