aoc2019/Day9.cs

31 lines
619 B
C#
Raw Normal View History

2019-12-09 08:58:22 +00:00
using System.Linq;
using aoc2019.lib;
2019-12-09 08:58:22 +00:00
namespace aoc2019
{
2020-12-02 04:50:35 +00:00
internal sealed class Day9 : Day
2019-12-09 08:58:22 +00:00
{
private readonly IntCodeVM vm;
public Day9()
{
2019-12-09 19:10:13 +00:00
vm = new IntCodeVM(Input.First());
2019-12-09 08:58:22 +00:00
}
public override int DayNumber => 9;
2020-12-02 06:58:54 +00:00
protected override string Part1()
2019-12-09 08:58:22 +00:00
{
vm.Reset();
vm.Run(1);
return $"{vm.output.ToDelimitedString(",")}";
}
2020-12-02 06:58:54 +00:00
protected override string Part2()
2019-12-09 08:58:22 +00:00
{
vm.Reset();
vm.Run(2);
return $"{vm.output.ToDelimitedString(",")}";
}
}
}