コード例 #1
0
 public static void DownloadMissingDays()
 {
     for (var i = 1; i < AdventOfCode.DaysReleased(); i++)
     {
         if (!File.Exists(GetLocalInputFilePath(i)))
         {
             DownloadDayInput(i);
         }
     }
 }
コード例 #2
0
        private static void Main(string[] args)
        {
            Environment.ExitCode = 1;

            var aoc = AdventOfCode.Build(config => config
                                         .ConfigureServices(ConfigureServices)
                                         .LoadCallingAssembly()
                                         .AddConsole()
                                         .AddClient());

            // adding console will force aggregate results of puzzles, otherwise iterate through the return value of runner.Run()
            aoc.Run();

            // foreach (var puzzleData in aoc.Run())
            // foreach (var result in puzzleData.Results)
            // {
            // }
        }
コード例 #3
0
 public void IntCodeComputerTest()
 {
     int[] opCodeSeq;
     int[] resOpCodeSeq;
     //first read the input data and create the op sequence.
     using (StreamReader sr = new StreamReader(Directory.GetCurrentDirectory() + @"\Resources\Day2Test.txt"))
     {
         while (!sr.EndOfStream)
         {
             opCodeSeq    = AdventOfCode.LineToArray(sr);
             resOpCodeSeq = AdventOfCode.LineToArray(sr);
             var output = AdventOfCode.IntCodeComputer(opCodeSeq);
             for (int idx = 0; idx < opCodeSeq.Length; idx++)
             {
                 Assert.AreEqual(resOpCodeSeq[idx], output[idx]);
             }
         }
     }
 }