Пример #1
0
        public override string SecondStar()
        {
            var input  = ReadInput();
            var result = HexagonPath.Furthest(input);

            return(result.ToString());
        }
Пример #2
0
        public override string FirstStar()
        {
            var input  = ReadInput();
            var result = HexagonPath.DistanceToDestination(input);

            return(result.ToString());
        }
Пример #3
0
        public void FirstStarPath(string directions, int shortestPath)
        {
            var destination = HexagonPath.Destination(directions);

            int path = (Math.Abs(destination.Y) - Math.Abs(destination.X)) / 2 + Math.Abs(destination.X);

            Assert.Equal(shortestPath, path);
        }
Пример #4
0
        public void FirstStarOrientation()
        {
            var destination = HexagonPath.Destination("ne,ne,sw,sw");

            Assert.Equal(new Point(0, 0), destination);
        }