using Maze; using Maze.Nodes; using Maze.Solvers; using Maze.Utlis; using Stone_Red_Utilities.ConsoleExtentions; MazeParser parser = new MazeParser(); MazePrinter printer = new MazePrinter(); IMazeSolver solver = new DepthFirstSearchMazeSolver(); try { DfsNode[,] maze = parser.FromFile("input.txt", out DfsNode startNode); if (Console.WindowHeight < maze.GetLength(0) || Console.WindowWidth < maze.GetLength(1)) { ConsoleExt.WriteLine("Console window size too small. Visualizing the maze may cause errors!", ConsoleColor.Red); ConsoleExt.Pause(true, "Press ENTER to continue or CTRL+C to exit the program."); } List solution = solver.Solve(startNode, maze, GraphicsMode.Colored); printer.PrintColored(maze, solution, redrawAll: true); ConsoleExt.WriteLine("Done", ConsoleColor.Green); } catch (MazeException e) { ConsoleExt.WriteLine(e.Message, ConsoleColor.Red); }