This project provides a solution for solving mazes from text files. The maze is represented as a grid where specific characters denote the start, end, and paths. The application reads multiple maze files, processes each maze, and finds the path from the start to the end, if it exists.
- Maze Parsing: Converts a maze from a string format into a 2D array.
- Maze Solving: Implements an algorithm to find the path in the maze.
- Path Formatting: Provides a readable format of the solution path, including the sequence of characters and directions.
data/
: Contains the maze files (1.txt
,2.txt
, etc.).util/index.js
: Utility functions such asreadFile
andparse2DString
.MazeSolver.js
: The main class responsible for solving the maze.app.js
: The entry point script that reads the maze files, solves them, and prints the results.
- Clone the repository:
git clone https://github.com/your-username/maze-solver.git cd maze-solver
- Install dependencies
npm install
- Run the application:
npm run dev
- Run the tests
npm test