Skip to content

A random maze generator and finding the path from the first to last cell.

Notifications You must be signed in to change notification settings

AshiqAR/Maze-Generator-and-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generator and Solver

This repository contains Python scripts for generating and solving mazes using the union-find algorithm. The maze is visualized using the turtle module. The project is split into three files: generateMaze.py, displayMaze.py, and mazeSolver.py.

Files

  • generateMaze.py: Contains the code to generate a maze and save it to a file.
  • displayMaze.py: Contains the code to visualize the generated maze.
  • mazeSolver.py: Contains the code to read the maze from a file, solve it, and display the solution path as the cell numbers starting from 0 to rows*colums-1.

Usage

Generating the Maze

Run the generateMaze.py script to generate a maze.

python generateMaze.py

You will be prompted to enter the number of rows and columns for the maze. The generated maze will be saved to Generated_maze.txt.

Solving the Maze

Run the mazeSolver.py script to read the maze from Generated_maze.txt, solve it, and display the solution path.

python mazeSolver.py

Requirements

Ensure you have the following dependencies installed:

  • Python 3.x
  • turtle module (included with Python's standard library)

Sample Generated Maze and its Solution

generated maze image

solved maze

About

A random maze generator and finding the path from the first to last cell.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages