Solve 2019 day 14 and 15

This commit is contained in:
2024-08-16 19:45:10 -04:00
parent 6efa70ea51
commit f88eb14d24
6 changed files with 258 additions and 2 deletions

View File

@@ -8,13 +8,13 @@ def part_1(data):
while not a.done:
a.go()
r = sum([a.outputs[i:i+3][2] == 2 for i in range(0, len(a.outputs), 3)])
r = sum([a.outputs[i : i + 3][2] == 2 for i in range(0, len(a.outputs), 3)])
print(r)
def part_2(data):
xs = str_to_ints(data)
xs[0] = 2 # play for free
xs[0] = 2 # play for free
a = Amp(xs)
ball_x = 0
paddle_x = 0