Code Monkey home page Code Monkey logo

maze-pathfinder's Introduction

โœจ maze-pathfinder โœจ

ss ss

๐Ÿ‘ทโ€โ™‚๏ธ Created by:

๐Ÿ“„ Description

This is a simple program that takes maze input in form of an image and solves it using the algorithm of your choice. Program outputs an image with drawn exit path (if the maze is valid).

Rules for a valid maze:

  • Every pixel that is not white will be interpreted as part of a wall.
  • The maze must have one starting point on top side, and one exit point on the bottom side (if there are multiple entry/exit points, only the first will be used so sometimes path will not be found)
  • The maze must be surrounded by walls (i.e. must be closed)
  • Corridors should be 1px wide because then the program works optimally, but it is not mandatory (the output will be correct for Dijkstra and A*, but might not be for DFS or BFS)

๐Ÿ’ป Installation

Download the project, navigate to the /src folder and run main.py

$ python main.py

You must have the /assets folder in the same root folder as /src folder (meaning you shouldn't move the files or folders around).

โ— Note: Requirements:

  • Python 2.7 (although it should work for 2.5 and above, but not tested)
  • Windows or Linux OS (MacOS is not supported)
  • For the program to work, you must have the PIL and Tkinter libraries installed. You can install packages using pip, for example:
$ sudo pip install python-pil
$ sudo pip install python-psutil

Additional information for PIL library can be found here. Tkinter should already be supported natively. psutil library is not necessary, but it's preferred to have it. If it's not installed, the program will always make two threads instead of the optimal number of them on the current machine.

  • RAM should not be a problem (if you don't want to benchmark), but if you decide to run mazes greater than 4000x4000, you will need around 1GB of free RAM memory for best performance.

๐ŸŽฎ Usage

Mazes are loaded from /mazes folder, and you can put your custom mazes there. After you input the file name, you will need to load the maze. Then select an algorithm and start the solver. It might take some time, depending of the maze size.

After that, you will find a new image in /mazes folder, named in the format: out_ which is the solution for the maze you entered.

You can also create you own maze! Expand the window by clicking on the arrow button. Choose your maze size and your maze will be created in /mazes folder, named in the format: generator_.

๐Ÿ› Known bugs

None so far!

maze-pathfinder's People

Contributors

milana-kovacevic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

stefazville

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.