Пример #1
0
        public static void TestDay01Part2()
        {
            var intPart2 = Day01Solution.GetPart2DistanceFromAlreadyVisit("R8, R4, R4, R8");

            NUnit.Framework.Assert.AreEqual(4, intPart2);

            intPart2 = Day01Solution.GetPart2DistanceFromAlreadyVisit("R1, R1, R2, R2, R3, R3, R2, R2");
            NUnit.Framework.Assert.AreEqual(1, intPart2);

            intPart2 = Day01Solution.GetPart2DistanceFromAlreadyVisit("R1, R2, R2, R3, R3, R2, R5");
            NUnit.Framework.Assert.AreEqual(2, intPart2);
        }
Пример #2
0
        public static void TestDay01Part1()
        {
            var intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R5, L5, R5, R3");

            NUnit.Framework.Assert.AreEqual(12, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R5, R5, R5, R5");
            NUnit.Framework.Assert.AreEqual(0, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R5, R5, R5, R5, R5, R5, R5, R5");
            NUnit.Framework.Assert.AreEqual(0, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R5, R5, L5, R5, R5, L5, L5, L5");
            NUnit.Framework.Assert.AreEqual(20, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R8, R4, R4, R8");
            NUnit.Framework.Assert.AreEqual(8, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R1, R1, R2, R2, R3, R3, R2, R2");
            NUnit.Framework.Assert.AreEqual(0, intPart1);

            intPart1 = Day01Solution.GetPart1DistanceFromStartingPoint("R1, R2, R2, R3, R3, R2, R5");
            NUnit.Framework.Assert.AreEqual(4, intPart1);
        }