Exemplo n.º 1
0
        private bool TryRun(List <Operation> instructions, out int acc)
        {
            var inter = new LoopInterpreter(instructions);

            acc = inter.Run();
            return(inter.ReachedEnd);
        }
Exemplo n.º 2
0
        public override void Solve()
        {
            var parser = new Parser();
            var runner = new LoopInterpreter(parser, Input);
            int result = runner.Run();

            Console.WriteLine($"Accumulator was at {result} before loop was found.");
        }