Git Product home page Git Product logo

procedural-maze-generator-algorithms's Introduction

Procedural-Maze-Generator-Algorithms and Maze solver

Check out my youtube channel : Auctux

Ressources

Requirements

PYGAME : pip install pygame

Commands Controls:

  • Esc to close the program
  • Enter to start to genrate the maze
  • H to show the heuristic cost value
  • S to show the path from the starting to the goal node
  • Space to switch between the color modes

files

  • run main.py for grid mazes
  • run polarMaze.py for polarGrid maze
  • run hexMaze.py for hexGrid maze
  • run imageMaze.py for maskGrid maze
  • run weightedMaze.py for weightedGrid maze

you can also braid your mazes when it done , by calling the function grid.Braid(). braiding a maze simply assures that the maze doens't have any deadends

colors modes

Mode 1 : Mode 2 :

other Maze Grid:

Polar Grid : HexGrid : maskGrid :

Show heuristic and path

  • heuristic :
  • showPath :

Bugs & Unsolved Issues

  • The code need a lot of refactoring
  • the visualization of the polar maze need a lot of improvement
  • the the imagemaze.py file need to be refactored for it to be able to work on every size of images , for now it's only working for images wich has the same size with the screen size
  • the recursive backtracker class need a little bit of cleaning
  • add Comments
  • implement the ui interface
  • the djikistra algorithm need to take the weights of cells in consideration for weightedGrid

mazes


initialize:
 binary_tree = BinaryTree(Grid(rows, cols, cell_size), "GREEN")
 wilson = Wilson(Grid(rows, cols, cell_size), "PURPLE_E")
 side_winder = SideWinder(Grid(rows, cols, cell_size), "BLUE")
 hunt_and_kill = HuntAndKill(Grid(rows, cols, cell_size), "RED")
 aldous_broder = AldousBroder(Grid(rows, cols, cell_size), "GREEN")
 recursive_backtracker = RecursiveBacktracker(Grid(rows, cols, cell_size), "BLUE")
 kruskal = Kruskals(Kruskals.State(Grid(rows, cols, cell_size)))
 simplePrims = SimplePrims(Grid(rows, cols, cell_size), "CYAN")
 prims = Prims(Grid(rows, cols, cell_size))
 growingTree = GrowingTree(Grid(rows, cols, cell_size), "GREEN")
 ellers = Ellers(Grid(rows, cols, cell_size), 0, "RED")
mainloop():
 wilson.Generate(screen, show_text, color_mode, show_path)
 binary_tree.Generate(screen, show_text, color_mode, show_path)
 kruskal.Generate(screen, show_text, color_mode, show_path)
 side_winder.Generate(screen, show_text, color_mode, show_path)
 hunt_and_kill.Generate(screen, show_text, color_mode, show_path)
 aldous_broder.Generate(screen, show_text, color_mode, show_path)
 recursive_backtracker.Generate(screen, show_text, color_mode, show_path)
 simplePrims.Generate(screen, show_text, color_mode, show_path)
 prims.Generate(screen, show_text, color_mode, show_path)
 growingTree.Generate(screen, show_text, color_mode, show_path)
 ellers.Generate(screen, show_text, color_mode, show_path)

  • Aldous Broder

  • Binary Tree

  • Eller's Algorithm

  • Growing Tree

  • Hunt And kill

  • Kruskal's algorithm

  • Prims Algorithm

  • Simplified Prims

  • Wilson algorithm

  • Sidewinder Algorithm

  • Recursive Backtracker

Enjoy โœŒ๏ธ

procedural-maze-generator-algorithms's People

Contributors

josephbakulikira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.