Пример #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) + "");
        }
    }
Пример #2
0
        public void DualChilds()
        {
            var input = "COM)A\nCOM)B";

            Assert.AreEqual(2, Day6Main.Part1(input));
        }
Пример #3
0
        public void SingleNode()
        {
            var input = "COM)B";

            Assert.AreEqual(1, Day6Main.Part1(input));
        }
Пример #4
0
        public void SingleLineNode()
        {
            var input = "COM)A\nA)B";

            Assert.AreEqual(3, Day6Main.Part1(input));
        }
Пример #5
0
        public void Exemple1Shuffled()
        {
            var input = "COM)B\nD)I\nD)E\nE)F\nB)G\nG)H\nB)C\nE)J\nJ)K\nC)D\nK)L";

            Assert.AreEqual(42, Day6Main.Part1(input));
        }