コード例 #1
0
        override public void part2()
        {
            IntcodeComputer computer = new IntcodeComputer();

            computer.loadProgramInput(2);
            for (int noun = 0; noun < 100; noun++)
            {
                for (int verb = 0; verb < 100; verb++)
                {
                    computer.createProgramFromInput();
                    computer.executeProgram(noun, verb);
                    if (computer.getComputerOutput(0) == 19690720)
                    {
                        System.Console.WriteLine("Day 2. Solution2 expected: 6429");
                        System.Console.WriteLine("Day 2. Solution2:" + (100 * noun + verb).ToString());
                        break;
                    }
                }
            }
        }