예제 #1
0
        public static void Solve()
        {
            int cols = 160;
            int rows = 40;

            GeometricPathTestCase         tc   = new GeometricPathTestCase(TerrainStr, new Coords(0, 0), new Coords(rows - 1, cols - 1));
            List <GeometricPathAStarNode> path = new AStar().FindShortestPath(new GeometricPathAStarNode(tc))
                                                 .Select(n => n as GeometricPathAStarNode).ToList();

            string result = DrawPathOnTerrain(TerrainStr, path, cols, rows);

            Console.WriteLine(result);
            File.WriteAllText(@"C:\Temp\Maze.txt", result);
        }
예제 #2
0
 public GeometricPathAStarNode(GeometricPathTestCase testCase)
 {
     TestCase = testCase;
     Coords   = TestCase.StartCoords;
     ComputeDistances();
 }