diff options
Diffstat (limited to 'Day9.cs')
-rw-r--r-- | Day9.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Day9.cs b/Day9.cs new file mode 100644 index 0000000..798d509 --- /dev/null +++ b/Day9.cs @@ -0,0 +1,32 @@ +using aoc2019.lib; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace aoc2019 +{ + internal class Day9 : Day + { + public override int DayNumber => 9; + private readonly IntCodeVM vm; + + public Day9() + { + vm = new IntCodeVM(Input.First().Split(',').Select(long.Parse).ToList()); + } + + public override string Part1() + { + vm.Reset(); + vm.Run(1); + return $"{vm.output.ToDelimitedString(",")}"; + } + + public override string Part2() + { + vm.Reset(); + vm.Run(2); + return $"{vm.output.ToDelimitedString(",")}"; + } + } +} |