···3535 ball_x = x
36363737 if ball_x < padd_x:
3838- inputs[0] = -1
3838+ inputs.append(-1)
3939 elif ball_x > padd_x:
4040- inputs[0] = 1
4040+ inputs.append(1)
4141 else:
4242- inputs[0] = 0
4242+ inputs.append(0)
43434444except StopIteration:
4545 print "Score after last block is broken:", score
+2-2
2019/day15.py
···2828 continue
29293030 # Attempt to move to next tile
3131- instructions[0] = d + 1
3131+ instructions.append(d + 1)
3232 resp = next(vm)
33333434 if resp == 0:
···4141 robot_dfs(vm, instructions, graph, np, d)
42424343 # Can't rely on call stack alone to backtrack
4444- instructions[0] = INVERSE_DIRS[approach_d] + 1
4444+ instructions.append(INVERSE_DIRS[approach_d] + 1)
4545 next(vm)
46464747
+1-1
2019/day17.py
···6161 instructions.append(ord('\n'))
62626363TAPE[0] = 2
6464-for c in emulate(TAPE[:], instructions):
6464+for c in emulate(TAPE[:], instructions[::-1]):
6565 try:
6666 print chr(c),
6767 except Exception:
+2-2
2019/day19.py
···1010 if x < 0 or y < 0:
1111 return 0
12121313- vm = emulate(TAPE, [x, y])
1313+ vm = emulate(TAPE, [y, x])
1414 return next(vm)
15151616···54545555 break
5656 else:
5757- print "Point checksum", x * 10000 + (y - 99)
5757+ print "100x100 point checksum:", x * 10000 + (y - 99)
5858 sys.exit()
+1-1
2019/day21.py
···29293030for instructions in (walking, running):
3131 program = [ord(c) for c in instructions]
3232- vm = emulate(TAPE, program)
3232+ vm = emulate(TAPE, program[::-1])
3333 try:
3434 while True:
3535 resp = next(vm)