Skip to content

Milosz-cat/Maze-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze-Solver

The Maze Solver is a Python program that uses Pygame to generate and solve mazes using two different algorithms: A* and Depth-First Search (DFS). The program generates a random maze, then finds a path from a random start point to a random goal point using both algorithms. The paths found by the algorithms are then animated on the screen.

Features

  • Maze Generation: The program generates a random maze using a depth-first search algorithm.
  • Pathfinding: The program uses both the A* and DFS algorithms to find a path from a random start point to a random goal point in the maze.
  • Animation: The program uses Pygame to animate the maze generation and pathfinding process.

Preview

Maze Solver Demo

Prerequisites

Make sure you have Python >=3.10 installed on your machine. You can download it from here.

Installation

  1. Clone the repo:

    git clone https://github.com/Milosz-cat/Maze-Solver.git 
    cd Maze-Solver
  2. Create a virtual environment and activate it:

    python -m .venv venv
    
    .\.venv\Scripts\activate (windows)
    or
    source .venv/bin/activate (linux)
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

Now you can start the script by typing following command:

python maze.py
or
python3 maze.py
or
py maze.py

This will generate a new maze, solve it, and save a visualization of the maze.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Simple maze solver with A* pathfinding algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages