34 lines
694 B
Python
34 lines
694 B
Python
from tools.aoc import AOCDay
|
|
from typing import Any
|
|
|
|
import intcode
|
|
|
|
|
|
class Day(AOCDay):
|
|
inputs = [
|
|
[
|
|
(1125899906842624, "test_input09_1_0"),
|
|
(4080871669, "input09")
|
|
],
|
|
[
|
|
(75202, "input09")
|
|
]
|
|
]
|
|
|
|
def part1(self) -> Any:
|
|
comp = intcode.IntCode(self.getInputAsArraySplit(",", int))
|
|
comp.addInput(1)
|
|
comp.run()
|
|
return comp.getOutput()
|
|
|
|
def part2(self) -> Any:
|
|
comp = intcode.IntCode(self.getInputAsArraySplit(",", int))
|
|
comp.addInput(2)
|
|
comp.run()
|
|
return comp.getOutput()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
day = Day(2019, 9)
|
|
day.run(verbose=True)
|