diff options
author | Ben Harris <ben@tilde.team> | 2019-12-13 15:35:49 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2019-12-13 15:36:28 -0500 |
commit | edd8e87b4c2bf960ae9747afec076d03b054724b (patch) | |
tree | 95dd94f042b398ee785ca35b0fc2e275127b4d1d /lib/IntCodeVM.cs | |
parent | 3103a7aef185654cb2245d83184cdb82af2b4d0c (diff) |
day 13
Diffstat (limited to 'lib/IntCodeVM.cs')
-rw-r--r-- | lib/IntCodeVM.cs | 7 |
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() |