Exemplo n.º 1
0
    private void CreateTaskForDay(int currentDay)
    {
        var input = AOCInput.GetInput(currentDay);

        if (currentDay == 1)
        {
            CreateTask(() => Day1Main.Part1(input), () => Day1Main.Part2(input));
            Day1Main.StartPart1ComputeShader(input);
        }
        else if (currentDay == 2)
        {
            CreateTask(() => Day2Main.Part1(input), () => Day2Main.Part2(input));
        }
        else if (currentDay == 3)
        {
            CreateTask(() => Day3Main.Part1(input) + "", () => Day3Main.Part2(input) + "");
        }
        else if (currentDay == 4)
        {
            CreateTask(() => Day4Main.Part1(input) + "", () => Day4Main.Part2(input) + "");
        }
        else if (currentDay == 5)
        {
            CreateTask(() => Day5Main.Part1(input) + "", () => Day5Main.Part2(input) + "");
        }
        else if (currentDay == 6)
        {
            CreateTask(() => Day6Main.Part1(input) + "", () => Day6Main.Part2(input) + "");
        }
        else if (currentDay == 7)
        {
            CreateTask(() => Day7Main.Part1(input) + "", () => Day7Main.Part2(input) + "");
        }
        else if (currentDay == 8)
        {
            CreateTask(() => Day8Main.Part1(input) + "", () => Day8Main.Part2(input) + "");
        }
        else if (currentDay == 9)
        {
            CreateTask(() => Day9Main.Part1(input) + "", () => Day9Main.Part2(input) + "");
        }
        else if (currentDay == 10)
        {
            CreateTask(() => Day10Main.Part1(input) + "", () => Day10Main.Part2(input) + "");
        }
        else if (currentDay == 11)
        {
            CreateTask(() => Day11Main.Part1(input) + "", () => Day11Main.Part2(input) + "");
        }
        else if (currentDay == 12)
        {
            CreateTask(() => Day12Main.Part1(input) + "", () => Day12Main.Part2(input) + "");
        }
        else if (currentDay == 13)
        {
            CreateTask(() => Day13Main.Part1(input) + "", () => Day13Main.Part2(input) + "");
        }
        else if (currentDay == 14)
        {
            CreateTask(() => Day14Main.Part1(input) + "", () => Day14Main.Part2(input) + "");
        }
        else if (currentDay == 15)
        {
            CreateTask(() => Day15Main.Part1(input) + "", () => Day15Main.Part2(input) + "");
        }
    }
Exemplo n.º 2
0
        public void Part2_Exemple1Full()
        {
            var intcode = "3, 26, 1001, 26, -4, 26, 3, 27, 1002, 27, 2, 27, 1, 27, 26, 27, 4, 27, 1001, 28, -1, 28, 1005, 28, 6, 99, 0, 0, 5";

            Assert.AreEqual(139629729, Day7Main.Part2(intcode));
        }
Exemplo n.º 3
0
        public void Part2_Exemple2Full()
        {
            var intcode = "3, 52, 1001, 52, -5, 52, 3, 53, 1, 52, 56, 54, 1007, 54, 5, 55, 1005, 55, 26, 1001, 54, -5, 54, 1105, 1, 12, 1, 53, 54, 53, 1008, 54, 0, 55, 1001, 55, 1, 55, 2, 53, 55, 53, 4, 53, 1001, 56, -1, 56, 1005, 56, 6, 99, 0, 0, 0, 0, 10";

            Assert.AreEqual(18216, Day7Main.Part2(intcode));
        }
Exemplo n.º 4
0
 public void Part2Answer()
 {
     Assert.AreEqual(21596786, Day7Main.Part2(Day7Input));
 }