Ejemplo 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) + "");
        }
    }
Ejemplo n.º 2
0
 public void Part2_Exemple2() => Assert.AreEqual(5586022, Day14Main.Part2(Ore180697));
Ejemplo n.º 3
0
        public void Part1_Exemple2()
        {
            var input = "9 ORE => 2 A\n8 ORE => 3 B\n7 ORE => 5 C\n3 A, 4 B => 1 AB\n5 B, 7 C => 1 BC\n4 C, 1 A => 1 CA\n2 AB, 3 BC, 4 CA => 1 FUEL";

            Assert.AreEqual(165, Day14Main.Part1(input));
        }
Ejemplo n.º 4
0
 public void Part2_Exemple1() => Assert.AreEqual(82892753, Day14Main.Part2(Ore13312));
Ejemplo n.º 5
0
        public void Part1_Exemple1()
        {
            var input = "10 ORE => 10 A\n1 ORE => 1 B\n7 A, 1 B => 1 C\n7 A, 1 C => 1 D\n7 A, 1 D => 1 E\n7 A, 1 E => 1 FUEL";

            Assert.AreEqual(31, Day14Main.Part1(input));
        }