Coding Challenge #10.4: Maze Generator with p5.js - Part 4

preview_player
Показать описание


Other Parts of this Challenge:

References:

Videos:

Related Coding Challenges:

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

#maze #recursion #backtracking #depthfirstsearch #p5js #javascript
Рекомендации по теме
Комментарии
Автор

I like that you go off track sometimes. it makes it easier to follow when it is not a constant stream of information for 30 min. Best code teaching channel on the internet.

magnushegdahl
Автор

Here's a simple optimization for the drawing part: Since any cell's left edge is gonna be its neighbor's right edge, and likewise for top/bottom (edge cases aside), you only need to draw bottom and right.

Awesome videos, I've been binging on them and playing along with Processing :)

Tordek
Автор

I wonder if Dan knows how many lives he's impacted by now. I've been coding for almost 30 years, pretty much my whole life, and still always learn something new from watching his channel.

DodaGarcia
Автор

I'd just ignore the complainers, you're amazing! Wish everyone had as much energy and knew how to make something so interesting. Liked and subscribed!

LH-tobi
Автор

Even in 2023 Never get tired of watching your tutorials, they are quite inspirational and right on spot thanks!

dagimchernet
Автор

has anyone told you that "you are awesome"? you are my friend. I now know how to build mazes.

AAAA-rbhm
Автор

I've been wanting to build this since FOREVER but I always thought I needed p5.js to build it, but now I've built one in GameMaker Studio and it feels so good! Just occurred to me that languages specifically built for games is not just for making games, it's for you to have a platform to express yourself through code.


Anyways, this channel is great and I just want to say thank you because you've been a great help :)

acex
Автор

Big like for this whole maze series, buddy!

DrkSder
Автор

This is the first one I've followed along with. I implemented this in Lua with Löve2D and had a blast doing so. You've earned a subscriber. I have the day off tomorrow and I think I'm gonna try to implement a different maze algorithm from the wiki page in the morning.

atonesb
Автор

You should only add the cell to the stack if it has more than one neighbor, that way it will instantly backtrack to a cell that has neighbors. Love these videos!

coltonjobes
Автор

This is somehow uplifting, i like your optimism and skills. Great job man! You make it look interesting.

PetarKaser
Автор

I was lucky. When I started fiddling with stacks, I had already played Magic: The Gathering for 5 years. The word stack is used there too, in exactly the same way, to keep track of the order certain card effects have.

When a player plays a card, its effects are added to the stack. If another card is played, its effects goes on the stack above the previous card effects and so on and so forth. Then you simply go backwards from the top of the stack and resolve each effect in the reverse order of which they were played.

For most players, this doesn't matter too much, but in tournaments, using (or abusing) the stack has turned the tide for many players.

morphman
Автор

Prior to watching this video I made this in C# with some interesting differences. Firstly I only tracked the top and left walls for each cell to avoid redundant data. I also tracked dead ends and intersections using different colors.

Keep up the great work btw!

xChrisx
Автор

Thanks for the inspiration! I'm writing this in Python3 because I'm terrible at JS, so I figure converting between the two languages will help me to improve my understanding of both 😁

quassseabass
Автор

Thanks for this amazing serie of videos. I've already saw many of this maze generation algorithms in my graduation but you're just an amazing teacher. I've created a randon dungeon generator using some principles that you've showed in this video.

GeeVaaz
Автор

Thank you Daniel! Infotainment at its finest 🤓

InsectInPixel
Автор

Wow I was actually able to follow along with the whole video series and got it to work properly!:) This is an awesome concept. I've seen lotsa videos where you get to a certain point and then there's just random errors :( I'd love to see more videos like this that show practical applications to programming concepts like stacks and all that good stuff. I'm a bit on the newer side and it can be hard to figure this stuff out the way you do

joezupko
Автор

7 Months later and still an awesome video. Nice job!

MrShmazoo
Автор

Glad I found your channel. I"m enjoying your challenges. On the backtracking, I think I prefer a maze that randomly pulls from the stack (or the subset that has neighbors) rather than always the last.

jakemalloy
Автор

6:43 Yup, we are basically there. AI is taking my Job as we speak.

NeozMemphisto