2022/day01: Remove debug lines and update tests
parent
ffc20daadd
commit
85107c66c3
|
@ -11,7 +11,6 @@ def part1(puzzle: TextIO) -> int:
|
||||||
cur_cals = 0
|
cur_cals = 0
|
||||||
|
|
||||||
for line in puzzle:
|
for line in puzzle:
|
||||||
print(line)
|
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
||||||
if line != "":
|
if line != "":
|
||||||
|
@ -29,12 +28,9 @@ def part2() -> int:
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
while i <= 3 - 1:
|
while i <= 3 - 1:
|
||||||
print(calories)
|
|
||||||
top = max(calories)
|
top = max(calories)
|
||||||
print(top)
|
|
||||||
calories.remove(top)
|
calories.remove(top)
|
||||||
three_total += top
|
three_total += top
|
||||||
print(three_total)
|
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,8 @@ from day01 import *
|
||||||
def test_part1() -> None:
|
def test_part1() -> None:
|
||||||
puzzle = open("day01.txt")
|
puzzle = open("day01.txt")
|
||||||
assert part1(puzzle) == 70613
|
assert part1(puzzle) == 70613
|
||||||
assert part2() == 205805
|
|
||||||
puzzle.close()
|
puzzle.close()
|
||||||
|
|
||||||
|
|
||||||
|
def test_part2() -> None:
|
||||||
|
assert part2() == 205805
|
||||||
|
|
Loading…
Reference in New Issue