diff options
Diffstat (limited to 'solutions/py/d09.py')
| -rw-r--r-- | solutions/py/d09.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/solutions/py/d09.py b/solutions/py/d09.py new file mode 100644 index 0000000..5a8f132 --- /dev/null +++ b/solutions/py/d09.py @@ -0,0 +1,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 |
