about summary refs log tree commit diff
path: root/lib/IntCodeVM.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2019-12-13 15:35:49 -0500
committerBen Harris <ben@tilde.team>2019-12-13 15:36:28 -0500
commitedd8e87b4c2bf960ae9747afec076d03b054724b (patch)
tree95dd94f042b398ee785ca35b0fc2e275127b4d1d /lib/IntCodeVM.cs
parent3103a7aef185654cb2245d83184cdb82af2b4d0c (diff)
day 13
Diffstat (limited to 'lib/IntCodeVM.cs')
-rw-r--r--lib/IntCodeVM.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/IntCodeVM.cs b/lib/IntCodeVM.cs
index b42a907..472da92 100644
--- a/lib/IntCodeVM.cs
+++ b/lib/IntCodeVM.cs
@@ -39,6 +39,11 @@ namespace aoc2019.lib
 
         public long Result => output.Dequeue();
 
+        public void AddInput(long value)
+        {
+            input.Enqueue(value);
+        }
+
         private long MemGet(long addr)
         {
             return addr < memory.Length ? memory[addr] : 0;
@@ -86,7 +91,7 @@ namespace aoc2019.lib
 
         public HaltType Run(params long[] additionalInput)
         {
-            foreach (var s in additionalInput) input.Enqueue(s);
+            foreach (var s in additionalInput) AddInput(s);
             return Run();
         }
         public HaltType Run()