public void TestManhattenDistance()
        {
            IDistance manDistance     = new ManhattenDistance();
            var       distanceManager = new DistanceManager(manDistance);

            var distance = distanceManager.calculateDistance(new Origin(0, 0), new Origin(1, 1));

            Assert.True(distance == 2);
        }
示例#2
0
        static void Main(string[] args)
        {
            ImportData();
            RunNavigationScript();
            int answer = ManhattenDistance.CheckManhattanDistance(new Point2(0, 0), ship.Location);

            Console.WriteLine($"The ship traveled {answer} units.");

            Console.Read();
            Environment.Exit(0);
        }