예제 #1
0
        public int DoPartTwo()
        {
            for (var noun = 0; noun <= 99; noun++)
            {
                for (var verb = 0; verb <= 99; verb++)
                {
                    Codes = PuzzleInputParser.CSVNumbersToList(fileLocation); // brilliantly inefficient
                    RestoreGravity(noun, verb);

                    var number = StartComputer();

                    if (number == 19690720)
                    {
                        return(noun * 100 + verb);
                    }
                }
            }
            return(0);
        }
예제 #2
0
 public IntCode(string fileLocation)
 {
     this.fileLocation = fileLocation;
     Codes             = PuzzleInputParser.CSVNumbersToList(fileLocation);
 }
예제 #3
0
 public void TestCalculateFuelRequiredForPartTwo()
 {
     Assert.AreEqual(165, PuzzleInputParser.CSVNumbersToList("DayTwo/Data.txt").Count);
 }