about summary refs log tree commit diff
path: root/lib/IntCodeVM.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2019-12-09 14:10:13 -0500
committerBen Harris <ben@tilde.team>2019-12-09 14:10:13 -0500
commit663d31564adf3d0714247a091021743ba0876e27 (patch)
tree2fb23ccd5687dcafe907bb8e9acefed3603341a8 /lib/IntCodeVM.cs
parenteb284a98c6febe943c81dc529d881f2a9752ee74 (diff)
move input parsing into vm class
Diffstat (limited to 'lib/IntCodeVM.cs')
-rw-r--r--lib/IntCodeVM.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/IntCodeVM.cs b/lib/IntCodeVM.cs
index f7699c6..b42a907 100644
--- a/lib/IntCodeVM.cs
+++ b/lib/IntCodeVM.cs
@@ -12,12 +12,12 @@ namespace aoc2019.lib
         private readonly long[] program;
         public Queue<long> input, output;
 
-        public IntCodeVM(IEnumerable<long> tape)
+        public IntCodeVM(string tape)
         {
             i = 0;
             relbase = 0;
-            program = tape.ToArray();
-            memory = tape.ToArray();
+            program = tape.Split(',').Select(long.Parse).ToArray();
+            memory = program;
             input = new Queue<long>();
             output = new Queue<long>();
         }