From 663d31564adf3d0714247a091021743ba0876e27 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 9 Dec 2019 14:10:13 -0500 Subject: move input parsing into vm class --- lib/IntCodeVM.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/IntCodeVM.cs') 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 input, output; - public IntCodeVM(IEnumerable 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(); output = new Queue(); } -- cgit 1.4.1