informatics-lab / maze

Generate web-based mazes and program virtual robots to solve them.
12 stars 4 forks source link

Add different maze generation algorithms #4

Open alastair-gemmell-lab opened 8 years ago

alastair-gemmell-lab commented 8 years ago

Currently mazes are generated using a single maze algorithm. It would be nice if there was a choice of different maze generation algorithms available. One benefit of this would be to create mazes with different characteristics. For example the current maze algorithm does not produce mazes with loops, and it does not produce any 'cross roads'.

See for example: http://weblog.jamisbuck.org/2011/2/7/maze-generation-algorithm-recap.html and https://en.wikipedia.org/wiki/Maze_generation_algorithm

josephwoodward commented 8 years ago

Really enjoyed this presentation. It'd be good to see some more algorithms added. :+1:

alastair-gemmell-lab commented 8 years ago

Thanks @JosephWoodward - glad you enjoyed it! I've now refactored so that the maze generation algorithm is abstracted out, allowing the user to choose an algorithm at run-time. I've added a second algorithm to the list which gives mazes of contrasting characteristics to the existing algorithm. For the time being I'll keep this issue open as it would be good to have more than two algorithms, and there are plenty more that could be added!