Ejemplo n.º 1
0
        public void BaseCases(string path1, string path2, int expectedDistance)
        {
            List <string> moves1   = path1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2   = path2.Split(',').Select(x => x.Trim()).ToList();
            int           distance = WirePathCalculator.FindClosetIntersectionManhattenDistance(moves1, moves2);

            Assert.Equal(expectedDistance, distance);
        }
Ejemplo n.º 2
0
        public void BaseCases(string path1, string path2, int expectedDistance)
        {
            List <string> moves1 = path1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2 = path2.Split(',').Select(x => x.Trim()).ToList();
            int           steps  = WirePathCalculator.FindIntersectionWithShortestNumberOfSteps(moves1, moves2);

            Assert.Equal(expectedDistance, steps);
        }
Ejemplo n.º 3
0
        public void Part1Answers()
        {
            List <string> moves1   = puzzleInputPath1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2   = puzzleInputPath2.Split(',').Select(x => x.Trim()).ToList();
            int           distance = WirePathCalculator.FindClosetIntersectionManhattenDistance(moves1, moves2);

            int expectedDistance = 5319;

            Assert.Equal(expectedDistance, distance);
        }
Ejemplo n.º 4
0
        public void Part2Answers()
        {
            List <string> moves1 = puzzleInputPath1.Split(',').Select(x => x.Trim()).ToList();
            List <string> moves2 = puzzleInputPath2.Split(',').Select(x => x.Trim()).ToList();
            int           steps  = WirePathCalculator.FindIntersectionWithShortestNumberOfSteps(moves1, moves2);

            int expectedSteps = 122514;

            Assert.Equal(expectedSteps, steps);
        }