Exemple #1
0
        public void TestDay3()
        {
            var day3 = new Day3("");

            var wire1a = new string[] { "R75", "D30", "R83", "U83", "L12", "D49", "R71", "U7", "L72" };
            var wire2a = new string[] { "U62", "R66", "U55", "R34", "D71", "R55", "D58", "R83" };

            Assert.AreEqual(159, day3.FindClosestDistanceToOrigin(wire1a, wire2a));

            var wire1b = new string[] { "R98", "U47", "R26", "D63", "R33", "U87", "L62", "D20", "R33", "U53", "R51" };
            var wire2b = new string[] { "U98", "R91", "D20", "R16", "D67", "R40", "U7", "R15", "U6", "R7" };

            Assert.AreEqual(135, day3.FindClosestDistanceToOrigin(wire1b, wire2b));

            Assert.AreEqual(610, day3.FindIntersectionWithLeastSteps(wire1a, wire2a));
            Assert.AreEqual(410, day3.FindIntersectionWithLeastSteps(wire1b, wire2b));
        }