Beispiel #1
0
        static void Main()
        {
            string[] input = File.ReadLines(@"./Programs/diagnostic.txt").First().Split(',');
            program = Array.ConvertAll(input, int.Parse);
            VM      = new IntCodeVM(program);

            while (true)
            {
                VM.LoadProgram(program);
                VM.Execute();
                Console.WriteLine("Program has Finished Executing");
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            program = FetchInput();
            vm      = new IntCodeVM(1, (long[])program.Clone(), new long[] { 1 });
            #if DEBUG
            vm.Verbose = true;
            #endif
            vm.Run();

            Console.WriteLine("Part 1: {0}", vm.Output);

            vm = new IntCodeVM(1, (long[])program.Clone(), new long[] { 5 });
            #if DEBUG
            vm.Verbose = true;
            #endif
            vm.Run();

            Console.WriteLine("Part 2: {0}", vm.Output);


            Console.ReadLine();
            Environment.Exit(0);
        }