diff options
author | Ben Harris <ben@tilde.team> | 2019-12-09 14:10:13 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2019-12-09 14:10:13 -0500 |
commit | 663d31564adf3d0714247a091021743ba0876e27 (patch) | |
tree | 2fb23ccd5687dcafe907bb8e9acefed3603341a8 /lib/IntCodeVM.cs | |
parent | eb284a98c6febe943c81dc529d881f2a9752ee74 (diff) |
move input parsing into vm class
Diffstat (limited to 'lib/IntCodeVM.cs')
-rw-r--r-- | lib/IntCodeVM.cs | 6 |
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>(); } |