summaryrefslogtreecommitdiffstats
path: root/solutions/py/d09.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-17 20:54:35 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-17 20:54:35 +0100
commitee96aa7c6ab8f0148e814630e77a726bf61530c0 (patch)
tree444376bc3ecfc235118558cace0de96f3aafd790 /solutions/py/d09.py
parentca4d3b189da7793ce8744246617c793c8640ce71 (diff)
downloadaoc-ee96aa7c6ab8f0148e814630e77a726bf61530c0.tar.gz
Rename 2019
Diffstat (limited to 'solutions/py/d09.py')
-rw-r--r--solutions/py/d09.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/solutions/py/d09.py b/solutions/py/d09.py
deleted file mode 100644
index ada6763..0000000
--- a/solutions/py/d09.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import intcode
-
-def do(input, code):
- program = [int(x) for x in input.split(",")]
- c = intcode.Computer(program)
- c.input = code
- output = []
- while True:
- c.step()
- #print(c.relative_base, c.pointer, c.memory)
- if c.SIG_HALT:
- break
- if c.output is not None:
- output.append(c.output)
- c.output = None
- return output
-
-def pt1(input):
- return do(input[0], 1)
-
-def pt2(input):
- return do(input[0], 2)
-
-if __name__ == "__main__":
- input = open("../input/09", "r").readlines()
- print(pt1(input))
- print(pt2(input))