File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,16 @@ def part1(input_text):
6969 return sum
7070
7171def part2 (input_text ):
72- return 0
72+ machines = parse (input_text )
73+ sum = 0
74+ for machine in machines :
75+ prize = machine ['prize' ]
76+ prize = (prize [0 ] + 10000000000000 , prize [1 ] + 10000000000000 )
77+ machine ['prize' ] = prize
78+ tokens = solver (machine )
79+ if tokens :
80+ sum += cost (tokens )
81+ return sum
7382
7483if __name__ == "__main__" :
7584 with open (__file__ .rsplit ('/' , 1 )[0 ] + "/input.txt" , 'r' ) as file :
Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ def test_cost(parsed_data):
4646 assert cost ([38 , 86 ]) == 200
4747
4848def test_part1 (sample_data ):
49- breakpoint ()
5049 assert part1 (sample_data ) == 480
5150
52- # def test_part2(sample_data):
53- # assert part2(sample_data) == 81
51+ def test_part2 (sample_data ):
52+ assert part2 (sample_data ) == 875318608908
You can’t perform that action at this time.
0 commit comments