예제 #1
0
def part2(data):
    cpu = Intcode(debug=False, wfi_mode=True)
    cpu.load_program(data)
    cpu.ram[0] = 2
    game = Game(cpu)
    game.start()
    return game.get_score()
예제 #2
0
def part1(data):
    cpu = Intcode()
    cpu.load_program(data)
    cpu.run()

    return len([
        tile for i, tile in enumerate(cpu.outputs) if (i % 3, tile) == (2, 2)
    ])