Beispiel #1
0
        public void It_runs_test_program_correctly()
        {
            var computer = new DockComputer();
            var program  = File.ReadLines("test.txt");

            computer.Run(program);
            Assert.AreEqual(165, computer.SumMemory());
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            DockComputer computer;
            var          program = File.ReadLines(args[0]);

            computer = new DockComputer();
            computer.Run(program);
            Console.WriteLine($"Sum of values in memory: [{computer.SumMemory()}]");

            computer = new DockComputer();
            computer.RunV2(program);
            Console.WriteLine($"Sum of values in memory: [{computer.SumMemory()}]");
        }