Ejemplo n.º 1
0
        public static void Run()
        {
            string[] input = System.IO.File.ReadAllLines("day10.txt");

            Simulation sim = new Simulation();

            foreach (var inp in input)
            {
                sim.AddInstruction(inp);
            }

            sim.Init();
            sim.Run();

            Console.WriteLine("==== Part 1 ====");
            Console.WriteLine($"17/61 Bot: {sim.Part1.Name}");
            Console.WriteLine();

            Console.WriteLine("==== Part 2 ====");
            Console.WriteLine($"Output product: {sim.Part2.Cast<int>().Aggregate(1, (a, b) => a * b)}");
        }