Skip to content

Commit 3dd1cc5

Browse files
Clean up Python projects
1 parent a414de5 commit 3dd1cc5

File tree

17 files changed

+132
-16
lines changed

17 files changed

+132
-16
lines changed

2020/python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

2020/python/aoc_2020/day01.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from itertools import permutations
33
from operator import mul
44

5-
input = open("2020/input/day01.txt").read()
5+
input = open("../input/day01.txt").read()
66
numbers = [int(x) for x in input.splitlines()]
77

88

2020/python/aoc_2020/day02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def parse_line(line):
66
return a, b, target, password
77

88

9-
input = open("2020/input/day02.txt").read()
9+
input = open("../input/day02.txt").read()
1010
passwords = [parse_line(x) for x in input.splitlines()]
1111

1212

2020/python/aoc_2020/day03.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from functools import reduce
22
from operator import mul
33

4-
input = open("2020/input/day03.txt").read().splitlines()
4+
input = open("../input/day03.txt").read().splitlines()
55

66

77
def traverse(step_x, step_y):

2020/python/aoc_2020/day04.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def parse_passport(data: str) -> Passport:
9393
return Passport(fields)
9494

9595

96-
with open("2020/input/day04.txt", encoding="utf8") as file:
96+
with open("../input/day04.txt", encoding="utf8") as file:
9797
passport_data = file.read().split(os.linesep + os.linesep)
9898
passports = [parse_passport(lines) for lines in passport_data]
9999

2020/python/aoc_2020/day05.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def find_seat_location(seat: str) -> Tuple[int, int]:
3434
return find_row(seat[:7]), find_column(seat[7:])
3535

3636

37-
with open("2020/input/day05.txt", encoding="utf8") as file:
37+
with open("../input/day05.txt", encoding="utf8") as file:
3838
seats = [find_seat_location(line) for line in file.read().splitlines()]
3939
seat_ids = [row * 8 + column for row, column in seats]
4040
max_seat = max(seat_ids)

2020/python/aoc_2020/day06.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def intersect(group: List[List[str]]) -> List[str]:
2121
return list(result)
2222

2323

24-
with open("2020/input/day06.txt", encoding="utf8") as file:
24+
with open("../input/day06.txt", encoding="utf8") as file:
2525
groups = [
2626
group.splitlines() for group in file.read().split(os.linesep + os.linesep)
2727
]

2020/python/aoc_2020/day07.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def count_children(color: str):
5454
return count_children("shiny gold")
5555

5656

57-
with open("2020/input/07.txt", encoding="utf-8") as file:
57+
with open("../input/07.txt", encoding="utf-8") as file:
5858
input = [parse_line(line) for line in file.readlines()]
5959
print("Part one:", part_one(input))
6060
print("Part two:", part_two(input))

2020/python/aoc_2020/day08.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def boot(code: list[str]):
2121
return acc, pos == len(code)
2222

2323

24-
with open("2020/input/08.txt", encoding="utf-8") as file:
24+
with open("../input/08.txt", encoding="utf-8") as file:
2525
input = file.readlines()
2626

2727
acc, _ = boot(input)

2020/python/aoc_2020/day09.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def part_two(invalid: int, input: list[int]):
2929
return part_two(invalid, input[1:])
3030

3131

32-
with open("2020/input/09.txt", encoding="utf-8") as file:
32+
with open("../input/09.txt", encoding="utf-8") as file:
3333
input = [int(line) for line in file.readlines()]
3434

3535
invalid = part_one(input)

0 commit comments

Comments
 (0)