Ejemplo n.º 1
0
        static void Day5()
        {
            WriteLine("--- Day 5: Sunny with a Chance of Asteroids ---");
            var program = "Day5/input.txt".ReadLines().Single().Split(",").Select(int.Parse).ToArray();

            WriteLine("Part 1 - AC Diagnostic");
            var(system, device) = QueueStoreSystem.CreateDuplux();
            device.Write(1);
            var copy = program.ToArray();

            Day5Computer.EvaluateProgram(copy, system);
            WriteLine(string.Join(",", device.Buffer));

            WriteLine("Part 2 - Extend thermal radiators");
            (system, device) = QueueStoreSystem.CreateDuplux();
            device.Write(5);
            copy = program.ToArray();
            Day5Computer.EvaluateProgram(copy, system);
            WriteLine(string.Join(",", device.Buffer));
        }
Ejemplo n.º 2
0
 public ProgramResult Resume(Span <int> program) => IntcodeComputer.EvaluateProgram(program, System, ProgramPointer);