The "Terminal Based Maze Solver" project is a Python implementation of a maze generation and solving algorithm. The project includes a maze generator that creates a random maze with a specified size and starting (S) and ending (E) points. Additionally, it features a depth-first search (DFS) algorithm to find a path from the starting point to the ending point in the generated maze.
The maze generation utilizes a stack-based algorithm to create a random maze. The algorithm ensures that there is only one path between the starting and ending points, making the maze solvable. The generated maze consists of cells marked as follows:
0: Wall(▓) 1: Open path(◌) 2: Starting point (S) 3: Ending point (E) 4: Path(◍)
The DFS algorithm is employed to find a path from the starting point to the ending point in the generated maze. The DFS explores possible paths, backtracking when necessary, until it successfully reaches the destination. The path is then displayed, and the maze with the path is printed.
The user can interact with the program through a simple console interface with the following options:
- Print the Path: Display the solution path in the generated maze.
- Generate Another Puzzle: Create a new random maze.
- Exit the Game: Terminate the program.
- bash git clone
https://github.com/kumarroshan123/Terminal_Based_Maze_Solver.git
To run the program, execute the Python script. Upon launching, the user will be prompted to enter the size of the maze. The program will then display the maze and provide options for interacting with the generated puzzle.
The project has no external dependencies beyond the standard Python library.
- The maze generator ensures that there is a solvable path from the starting point to the ending point.
- The DFS algorithm employs a recursive approach to explore possible paths within the maze.
- The solution path is marked with a different symbol ("-1") in the displayed maze.