summaryrefslogtreecommitdiffstats
path: root/solutions/py/d09.py
blob: 5a8f132ead8412d2534352efc0653d414505ca19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import intcode

input = open("../input/09", "r").readlines()[0]

program = [int(x) for x in input.split(",")]
c = intcode.Computer(program)
c.input = 2
while c.memory[c.pointer] != 99:
    c.step()
    #print(c.relative_base, c.pointer, c.memory)
    if c.output is not None:
        print(c.output)
        c.output = None