Beispiel #1
0
        private static void Part1(ref long[] input)
        {
            var arcade   = new Arcade();
            var joystick = new JoyStick();
            var computer = new Computer(input, joystick, arcade);

            computer.Wait().GetAwaiter().GetResult();
            Console.SetCursorPosition(0, 25);
            Console.WriteLine(arcade.BlocksLeft());
            input = computer.GetCurrentState();
        }
Beispiel #2
0
        public void Run()
        {
            var instructions = File.ReadAllText("Day13.txt")
                               .Trim()
                               .Split(",", StringSplitOptions.RemoveEmptyEntries)
                               .Select(x => long.Parse(x))
                               .ToList();

            var arcade   = new Arcade();
            var computer = new Computer(new Memory(instructions), arcade: arcade);

            computer.Run(debug: false);
            Console.OutputEncoding = Encoding.UTF8;
            arcade.Print();
        }