/* * After I finished the first method, I try to think this problem again * (because I like solving puzzle games as I mentioned in the interview), * and I came up with another solution. * This method will like an AI calculating the maze. * It will try to check the four directions of one point, * and then recursively check the four directions of the next point * until it finds the end point. * So I call it AIProcessor. */ private static void SecondWayToResolveMaze() { var maze = MazeService.InitialMaze(FILE_NAME); if (maze != null) { AIMazeProcessor processor = new AIMazeProcessor(); processor.SolveMaze(maze); MazeService.OutputMaze(maze.MazeMatrix, "F:\\MazeSolution2.txt"); } }