aoc2019/day05.py
Stefan Harmuth c98135a75a day05
2021-11-27 06:34:51 +01:00

25 lines
615 B
Python

from aoc import AOCDay
from intcode import IntCode
from typing import Any
class Day(AOCDay):
test_solutions_p1 = []
test_solutions_p2 = []
def part1(self) -> Any:
comp = IntCode(self.getInputAsArraySplit(",", int))
comp.input.put(1)
comp.run()
while True:
if (check := comp.output.get()) != 0:
return check
def part2(self) -> Any:
comp = IntCode(self.getInputAsArraySplit(",", int))
comp.input.put(5)
comp.run()
while True:
if (check := comp.output.get()) != 0:
return check