Coding Challenge #10.4: Maze Generator with p5.js - Part 4
Choo choo! In this multi-part coding challenge, I create a maze generator using a depth-first search algorithm with recursive backtracking. The idea is to walk through a grid of cells, removing walls as we go to build a maze. Code: https://thecodingtrain.com/challenges/10-dfs-maze-generator
đšī¸ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/EBkm4txSA
Other Parts of this Challenge:
đē Part 1: Creating the Cells: https://youtu.be/HyK_Q5rrcr4
đē Part 2: Visiting Neighboring Cells: https://youtu.be/D8UgRyRnvXU
đē Part 3: Removing Walls: https://youtu.be/8Ju_uxJ9v44
đĨ Previous video: https://youtu.be/FGAwi7wpU8c?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ Next video: https://youtu.be/IKB1hWWedMk?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
đ Maze Generation Algorithm: https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_depth-first_search
Videos:
đ´ Live Stream Archive: https://youtu.be/nF7DVmovWr0?t=9276s
Related Coding Challenges:
đ #51 A* Pathfinding Algorithm: https://youtu.be/aKYlikFAV4k
đ #76 10Print: https://youtu.be/bEyTZ5ZZxZs
đ #171 Wave Function Collapse: https://youtu.be/rI_y2GAlQFM
Timestamps:
00:00 Where are We so Far?
00:51 Let's Look at the Algorithm
01:36 What is a Stack?
04:32 Code! Create a Stack
04:57 Push the Current Cell to the Stack
05:23 Backtrack if we get Stuck
07:37 Done! How can You Improve on this?
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
đ Website: http://thecodingtrain.com/
đž Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
đŠ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
đĄ GitHub: https://github.com/CodingTrain
đŦ Discord: https://discord.gg/hPuGy2g
đ Membership: http://youtube.com/thecodingtrain/join
đ Store: https://standard.tv/codingtrain
đī¸ Twitter: https://twitter.com/thecodingtrain
đ¸ Instagram: https://www.instagram.com/the.coding.train/
đĨ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
đĨ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
đ p5.js: https://p5js.org
đ p5.js Web Editor: https://editor.p5js.org/
đ Processing: https://processing.org
đ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#maze #recursion #backtracking #depthfirstsearch #p5js #javascript