コード例 #1
0
        public void TestVisit()
        {
            var map    = BuildMap();
            var solver = new AdmiralSolver(map);
            var route  = solver.FindRoute(6);

            Assert.AreEqual(86, route.Blue.Sum(x => x.Passage.Cost) + route.Red.Sum(x => x.Passage.Cost));
        }
コード例 #2
0
        public void TestVisit()
        {
            var map = BuildMap();
            var solver = new AdmiralSolver(map);
            var route = solver.FindRoute(6);

            Assert.AreEqual(86, route.Blue.Sum(x => x.Passage.Cost) + route.Red.Sum(x => x.Passage.Cost));
        }
コード例 #3
0
        private IEnumerable <Waypoint> BuildMap()
        {
            var entries = new List <string>();

            entries.Add("1 2 23");
            entries.Add("1 3 12");
            entries.Add("1 4 99");
            entries.Add("2 5 17");
            entries.Add("2 6 73");
            entries.Add("3 5 3");
            entries.Add("3 6 21");
            entries.Add("4 6 8");
            entries.Add("5 2 33");
            entries.Add("5 4 5");
            entries.Add("6 5 20");

            return(AdmiralSolver.CreateMapFromString(entries));
        }