Programming Mazes

  Рет қаралды 196,388

javidx9

javidx9

Күн бұрын

Пікірлер: 356
@H2CO3Szifon
@H2CO3Szifon 7 жыл бұрын
This video is a mazing.
@Erebus2075
@Erebus2075 5 жыл бұрын
haha such dad humor :P
@christophergeorgi6419
@christophergeorgi6419 4 жыл бұрын
This video is indeed a maze thing.
@TheRealTrimBrady
@TheRealTrimBrady 4 жыл бұрын
You little...
@skipfred
@skipfred 3 жыл бұрын
☹️
@greenkerbal632
@greenkerbal632 3 жыл бұрын
Listen here you little sh..
@marksandles259
@marksandles259 7 жыл бұрын
just discovered your channel today... Don't normally write in comments sections... but.. really enjoying your videos. please continue the good work.
@javidx9
@javidx9 7 жыл бұрын
Hey thanks Mark. Comments like that make it worthwhile.
@Noone-rc9wf
@Noone-rc9wf 5 жыл бұрын
You cannot tell me this isn't the same guy talking to himself
@qoobes
@qoobes 4 жыл бұрын
About two years later, I discovered it today. Same impression, love it.
@Richard_is_cool
@Richard_is_cool 4 жыл бұрын
Very true. This is, for example, the first time I saw a comment of yours.
@marksandles259
@marksandles259 4 жыл бұрын
@@Noone-rc9wf I can tell you it isn't the same guy... My coding sucks ass.... if I make a asterisk bounce round the screen I start dancing around the room.... I'm just a nice person giving someone positive feedback...
@Jetpans
@Jetpans 4 жыл бұрын
Now the man makes an algorithm to solve your maze in under 1 minute. The everlasting competition of coders.
@emjizone
@emjizone Жыл бұрын
If you are in a hurry and like to clone code, you can use almost *the same algorithm* as this generator, and *replace the random direction part with exploration test.* But you'd better use *_double-ends-A_** algorithm instead. Feel free to prove me wrong, or to call me to work together on *amazing* 2D, 3D, nD maze generators and solvers.
@sebe3243
@sebe3243 Жыл бұрын
I found a new use for this algorithm! It's really good at generating oceans/continents. Visited cells are water cells, unvisited are land cells. If the algorithm stops after visiting about 60% of the cells you can get smaller and larger islands, continents, even some rivers! Really cool stuff 👍
@daskonstrukt8392
@daskonstrukt8392 7 жыл бұрын
As always, i cant believe this video has "only" 300 views. Keep up the awesome work!
@javidx9
@javidx9 7 жыл бұрын
Cheers Konstrukt! I'm not very good at promoting the channel. Sure I'd love more views, but I'm not monetising so there's little incentive for KZbin to promote the channel either. As long as people engage with the content - I'm happy! No "Hey Guys! What is up?" dodgy thumbnail click-bait rubbish from me..
@javidx9
@javidx9 7 жыл бұрын
Thanks Riptide! :")
@FredM80
@FredM80 7 жыл бұрын
Too few people like programming and understanding old algorithms. Actually, many programmers like "not to re-invent the wheel". sad...
@tahwnikcufos
@tahwnikcufos 6 жыл бұрын
2,810 views... this is a good "code along" video.
@81gamer81
@81gamer81 6 жыл бұрын
Great videos indeed. wish yt suggested the channel sooner
@weisjerry
@weisjerry 2 жыл бұрын
Excellent explanation! I like how you went over the algorithm first before dropping into code. I’ve always marveled how the best algorithms are often the most clean and simple.
@nadiequintero9981
@nadiequintero9981 4 жыл бұрын
I absolutely love your coding style! So clean and understandable, without unnecessary complications. I'll try to learn from you, thank you for all your content!
@oliverdacracker
@oliverdacracker 4 жыл бұрын
This is the greatest KZbin channel that I have had the pleasure to stumble upon.
@johnpenner5182
@johnpenner5182 2 жыл бұрын
using the stack to pop back the path, whilst keeping tracking of total visited cells is a very nice elegant algorithm. thanks for this! 🙏🏻
@javidx9
@javidx9 2 жыл бұрын
Yeah it is. Breadth First Searches like this are a staple computer algorithm that have been around since the dawn of programming. By eliminating the need to recurse, it also removes all the problems associated with recursion too.
@nailbomb420
@nailbomb420 7 жыл бұрын
great video, just going through you're stuff at random - it's a treasure trove! You have a great sense of humour, and manage to choose the most interesting topics :)
@javidx9
@javidx9 7 жыл бұрын
Thanks CodeyThings!
@ravensncrows
@ravensncrows 2 жыл бұрын
Boo gplv3 boooo
@didaloca
@didaloca 4 жыл бұрын
I read an article a while back where someone created a similar maze using only template meta programming, which was randomised each time it was re-compiled. Pretty mind blowing really.
@udoc.7528
@udoc.7528 4 жыл бұрын
I found this channel while I was looking for how a game coder works - not a video with visual impressive graphical presentation, but the "ugly" unspectacular hard part of coding thousends of lines and how it is possible to keep an overview. Then stuck to your channel because the quality of your videos especially the content (programs and explanations) is excellent and I learned much here (for example the use of the modulo operator and many other "tricks") I like how you concentrate on what matters - the ideas and algorithms and how smart you code. Today I finished my own (primitive) maze program with the 15 unicode chars 0x2554, 0x2557 and so on, without using one of your game engines but with parts of your code and ideas. It creates the maze in one tick so it is not as good for visualisation as yours but it shows me that I really understood your code. To repeat all calculations in every single frame (OnUserUpdate function) is very time consuming and only possible in that ultrafast C/C++ language (or maybe assembler if one is capable of coding in this). Greetings from Germany and I wish you many good ideas for more programs to show.
@Drogba402
@Drogba402 7 жыл бұрын
This channel deserves more subscribers
@javidx9
@javidx9 7 жыл бұрын
Giant Panda Thanks!
@AndreiNeacsu
@AndreiNeacsu 5 жыл бұрын
While I agree that this channel should have more than 10 million subscribers, I realize that maybe there are simply not that many smart people in the whole world. It would require something like more than 10 mega smart people.
@T3RRY_T3RR0R
@T3RRY_T3RR0R 3 жыл бұрын
Never ceases to impress me how you can take a advanced concept and break it down to very simple terminology. In just the first five minutes you've broken the method by which the algorithm operates down enough for me to understand how to implement it programmaticly.
@vascoalmeida4839
@vascoalmeida4839 4 жыл бұрын
A couple of years ago, this video of yours inspired me to writing my first Python/Tkinter application: my idea of coding something useful for practice and keeping my grandchildren quietly entertained. Little did I know that after all this time, a discussion in redditt's r/learnpython thread led me to tell the world about it. The response was amazing, and I have felt compelled to use Github for the first time to make available my first clumsy effort. The code starts with a couple of sentences where I told this story and show my indebtedness to your original presentation; coupled with a proviso that you are not responsible for the 'quality' of the coding. Thank you so much.
@javidx9
@javidx9 4 жыл бұрын
Hey that's great Vasco, well done!
@AcceleratingUniverse
@AcceleratingUniverse 5 жыл бұрын
this was our final project for "introduction to computer science 2" in college; we used both a dfs/stack and bfs/queue (and we had to make the stack and queue). we also had to find the shortest path from the entrance to the exit. ours used ncurses in a gnu/linux terminal! if you have been programming for a couple months, i'd strongly recommend trying that out, it taught me a ton about a programming.
@Codejoy
@Codejoy 6 жыл бұрын
One of my more favorite videos I have seen. Subscribed a while ago, just a really enjoyable view, everyone of these !
@javidx9
@javidx9 6 жыл бұрын
Hey thanks Shane!
@iMamoMC
@iMamoMC 5 жыл бұрын
I just discovered your channel, and I must say that you're doing a great job at explaining. I especially love how you always take a simple, effective approach (I especially appreciated the method you used for rotation in Tetris). Keep it up! ^^
@haltarys
@haltarys 5 жыл бұрын
"Two minutes to create a maze that would take one minutes to solve" ? That's a line from Inception !
@TheAngelOfDeath01
@TheAngelOfDeath01 3 жыл бұрын
Yes.
@FinBoyXD
@FinBoyXD 5 жыл бұрын
I dont believe you did that in two minutes.
@konstantinrebrov675
@konstantinrebrov675 4 жыл бұрын
The algorithm runs in two minutes and creates the maze for you.
@Saleca
@Saleca 4 жыл бұрын
Of course he did, then he slow down to explain it to us mortals
@matschbirne5363
@matschbirne5363 4 жыл бұрын
Salu omnidentidade The only thing limiting him is the speed of light lol.
@killermonkey1392
@killermonkey1392 4 жыл бұрын
The way you‘re using bitwise operations has somewhat opened my eyes. I knew about bitwise operations and I also knew about using sums of powers of 2 to store information (e.g. in chmod commands), but I never thought about using it to essentially store several booleans in a single value. Thank you for this video!
@DFPercush
@DFPercush 4 жыл бұрын
Yep, bit flags are very useful, especially for passing a single argument to a function that toggles several different modes of operation. Modern C++ also has bit fields: struct something { int a:1; int b:2; int c:3;} etc. a is basically a boolean, but c:3 could have a value from 0-7. If you need very small integer values you can pack them into a single byte or the smallest integer type that will fit them all. You can't pass pointers or references to them though, only by value.
@botsjeh
@botsjeh 4 жыл бұрын
@@DFPercush bit fields aren't modern C++, bit fields existed in C since it was created in the 70's
@altheahicks9574
@altheahicks9574 4 жыл бұрын
Hey, just want to say thanks! I've learned so much from your videos, and continue to learn more.
@erichenriquez3641
@erichenriquez3641 4 жыл бұрын
I'm really enjoying your videos, took me a long time to discover this channel, hope you keep making this.
@javidx9
@javidx9 4 жыл бұрын
Thanks Eric, will do!
@stichtingyimak9695
@stichtingyimak9695 4 жыл бұрын
1:57 into this video and im already convinced that this is awesome.
@kevnar
@kevnar 5 жыл бұрын
I once made a 4D maze. At every location of the maze, you could go up, down, left, right, backward, or forward, but you could also warp to an alternate maze and continue from there. Very easy to design with this algorithm, but very confusing to solve, especially since the display was only 2D.
@javidx9
@javidx9 5 жыл бұрын
Errrrr. Yeah now my brain hurts. Thanks! XD
@johnvonhorn2942
@johnvonhorn2942 5 жыл бұрын
Hahaha, you strike me as an evil genius. You're operating on a higher plane #GodLike
@BichaelStevens
@BichaelStevens 2 жыл бұрын
But can you create your own kernel from scratch?
@EmanueleMicciulla
@EmanueleMicciulla 3 жыл бұрын
I learned this from the same magazine! In italy it was distributed by De Agostini with the name "Input"
@overratedprogrammer
@overratedprogrammer Жыл бұрын
This video was so helpful and inspiring. I came here for a maze for my genetic algorithm but also got inspiration for a mining tunnel game. Everytime I think of mazes I will think of this video for the rest of my life
@BluesManPeich
@BluesManPeich 4 жыл бұрын
"rarely the programs did actually work" - can confirm this. Good times!
@vadimdidenko1443
@vadimdidenko1443 2 жыл бұрын
thanks to this video I learned bitwise operations and better understood hex numbers, thank you!) First two days I only understood the general operation of the code while struggling to figure out what |= and & means in the particular case but on the third day I finally figured out everything Had to spend some time with pen and notebook studying code symbol by symbol. I am very grateful for your videos and the fealing of satisfaction after understanding everything!
@EmajlPL
@EmajlPL 7 жыл бұрын
Damm why this channel has so little subs and views. Good work man!
@javidx9
@javidx9 7 жыл бұрын
Hey thanks Emajl, glad you find some of it interesting! You've stumbled across our secret society. Welcome to the club!
@scottcooper3107
@scottcooper3107 6 ай бұрын
Thanks. Really good information. I don't understand some of the newer C++ syntax, but that's ok. I understand the algorithm, thanks to your video. I decided to make this algorithm work on the old color computer from Radio Shack in basic with 64k. But only 32k is available. I wanted to make a maze of grid size 127x95 in a resolution of 256x192. I needed a array of 12065 bytes to hold the grid. Then another 24k for the stack. That is roughly 36K. Way over the amount I have to work with. I came up with a different way to save space .So instead of using a stack to hold x and y locations of cell, I decided to use 2 bits in the cell array data to hold a number between 0-3. Those numbers would represent the direction that the cell came from. Now, each byte in cell array has 4 bits for the walls, 1 bit for visited or not.1 bit for backtrack or not and 2 bits for direction cell came from. Some crazy reason, it worked. :) Anyway, I thought I would share my algorithm modification info in case anyone else ran into memory constraints on old retro computers. I was able to cut memory usage from 36K to 12K.
@shadowdragon7362
@shadowdragon7362 5 ай бұрын
Personally I also did this but instead of keeping which direction each cell came from I actually while generating the maze have all walls built, meaning it's just a grid of squares and each time I move to a cell I break the wall in the direction I went, that way I do not need to store any direction but instead just perform it instantly.
@FrankWilleke
@FrankWilleke Жыл бұрын
What a fun algorithm! Really simple to implement, and it also provides the solution route for the maze, if the goal position is known upfront. I couldn’t find a clever way of multithreading it yet, though.
@code-dredd
@code-dredd 5 жыл бұрын
Great video. I wrote a sudoku solver using a backtracking algorithm as well, but instead of using a stack object, I relied on the function stack frames by using a recursive backtracking approach. I like that the solving function looks simpler when using recursion :D
@Rx7man
@Rx7man Жыл бұрын
aMAZEing.. I did a similar thing for solving an arbitrary maze.. this inspired me to go look at that again and make it make a maze
@BeerBong97
@BeerBong97 4 жыл бұрын
This is the absolute best channel on the internet
@gregorymeadows3572
@gregorymeadows3572 5 жыл бұрын
Really good explanation. I recently converted the example code on the Wikipedia page from c to C++ to use in my game. I could follow the code alright, but this was a nice explanation of the stack and how that can make it a bit easier to follow. Stack is still there in mine, just implemented differently.
@javidx9
@javidx9 5 жыл бұрын
Thanks Gregory! There are "stackless" implementations also, but they just emulate a stack with numbers and offsets anyway :D
@sergiojimenez3445
@sergiojimenez3445 7 жыл бұрын
you should have more views, I feel lucky to find this channel
@javidx9
@javidx9 7 жыл бұрын
Hi Sergio, thanks for the compliment. I agree, more views would be nice, and I think finding quality, hidden youtube channels is rewarding too.
@fzac
@fzac 4 жыл бұрын
This video is incredible. Thank you.
@MuratMaman
@MuratMaman 3 жыл бұрын
This is a amazing video, it has been a while since I was looking for. Thank you for your great work.
@scififan698
@scififan698 3 жыл бұрын
ah, such fun! I coded something very similar when I was a little kid, and I still like to watch you make algorithms like this. more, we want more! ;-) subscribed.
@javidx9
@javidx9 3 жыл бұрын
Glad you enjoyed it, thanks!
@TheDyingFox
@TheDyingFox 4 жыл бұрын
16:19 when loops look like that (with math indexed arrays) is usually when I get lost xD 20:10 that's a new one (to me, a lot has happen apparently since I programmed), a function inside a function... Funception!
@truthteller4689
@truthteller4689 5 жыл бұрын
I like your setup. It looks like the Matrix.
@dorjderemnamsraijav5182
@dorjderemnamsraijav5182 4 жыл бұрын
This is the greatest channel i have ever seen on youtube! All of your contents are amazing. Can you show us how to make fluid simulation in c++?
@MrSinedddd
@MrSinedddd 3 жыл бұрын
This guy is the greates teacher I have ever met.
@likeyou3317
@likeyou3317 5 жыл бұрын
Good ol' mazes, happy to see ur channel grow :)
@javidx9
@javidx9 5 жыл бұрын
lol yeah, the oldies are the best ones. Thanks man!
@amancalledbob
@amancalledbob 7 жыл бұрын
Really enjoying these videos. Time to dust of my programming head and have a play.
@javidx9
@javidx9 7 жыл бұрын
Hi Bob. Thanks for the great response. Comments like that make it all worth while!
@alfiewhitson7726
@alfiewhitson7726 5 жыл бұрын
this video was a maze-ing
@javidx9
@javidx9 5 жыл бұрын
Ba boom tish!
@100Amida
@100Amida 5 жыл бұрын
Just something small I noticed. You don't need to keep a count of the number of cells visited. If you reach the bottom of the stack and there are no neighbors, then you know the maze is done. Upon further reflection, I think reaching the bottom of the stack will always leave you with no neighbors. Say everywhere in the maze is filled in, except one cell directly neighboring the start cell. As the stack pops, it will encounter a different neighbor of that cell before returning to the start cell, and this different neighbor will generate the path instead. Similarly for any larger empty region, we must fill it in before we can pop the stack to the bottom.
@Xymarue
@Xymarue 5 жыл бұрын
If you got a stack of 2000 cells, you repeat the same code till your stack is empty, using a count variable would automatically stop the algorithm when it's done
@professorracc.9780
@professorracc.9780 3 жыл бұрын
that algorithm is pretty ingenious
@22rw
@22rw 3 жыл бұрын
wow, this video helped me out so much, thank you!
@QouteOfTheDay
@QouteOfTheDay 6 жыл бұрын
Thank you for this wonderful video.
@javidx9
@javidx9 6 жыл бұрын
Hey Thanks First Mill, my pleasure!
@thesanctuary225
@thesanctuary225 5 жыл бұрын
You are a Wizard of C++.
@levchyk10
@levchyk10 6 жыл бұрын
Thank you for making such good videos and motivating others to make their own! Keep on :)
@javidx9
@javidx9 6 жыл бұрын
My Mykola, thank you very much for watching and enjoying them! I will!
@nicolaibergmann6613
@nicolaibergmann6613 6 жыл бұрын
I just built this in processing and my desktop background is now a maze :D
@javidx9
@javidx9 6 жыл бұрын
Hi thats cool Nicolai, do you get new mazes each time you start up?
@nicolaibergmann6613
@nicolaibergmann6613 6 жыл бұрын
No, but that would be awesome!! I don't know how to do that tho... I just saved a maze as static image and set it as my desktop background... Is there a way to do that automatically?
@DFPercush
@DFPercush 4 жыл бұрын
# include SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "maze.bmp", 0); Bitmaps are super easy to work with, you can just dump a raw array into a file basically. BITMAPFILEHEADER and BITMAPINFOHEADER are the windows structs for bitmap files, just populate them and dump the memory out to a file, then the pixels, and you're all set. docs.microsoft.com/en-us/windows/win32/gdi/bitmaps
@nicolaibergmann6613
@nicolaibergmann6613 4 жыл бұрын
@@DFPercush Thanks, I might try that!
@DarkEgo2468
@DarkEgo2468 3 жыл бұрын
My first maze was done on a RadioShack model 1. I used a string variable as the stack. Back in 1980
@barmetler
@barmetler 5 жыл бұрын
Absolutely beautiful.
@tidwellscott
@tidwellscott 5 жыл бұрын
I realized the maze is the same every time. is there any way to fix this?
@javidx9
@javidx9 5 жыл бұрын
Yes Scott, you can seed the random number generator, add something along the lines of srand(time()) to OnUserCreate.
@Asimov16
@Asimov16 5 жыл бұрын
I remember this algorithm from Sinclair User, and you are correct, it didn't work after 3 pages of typing in the code LOL
@skyhorn9070
@skyhorn9070 7 жыл бұрын
So good and calm explanation! I personally think, that it would be awesome that you break down those long lines of code into separate functions and teach people how not to make a blob! :D But overall, its great man
@javidx9
@javidx9 7 жыл бұрын
Thanks Skyhorn! I try to avoid excessive encapsulation where I can as it bloats the code, but it's a difficult balance to get right I agree.
@tahwnikcufos
@tahwnikcufos 6 жыл бұрын
Saw 8bits of C++ first, ehh, then this one, subbed... might be a good idea to close any unused toolbox and explorer windows, to get more code on screen, as well as roll back the zoom a bit, and hide the main menu... great video, thanks!
@javidx9
@javidx9 6 жыл бұрын
Cheers, yeah, I was still finding my feet with the whole making videos back then (still am to be fair!) Thanks!
@tahwnikcufos
@tahwnikcufos 6 жыл бұрын
I take that back, 8 bits was second - I watched "What is Assembly Language?" first. Inspired me to start using OneNote again... now that I have a Surface. I gave up on C++ years ago, in favor of VBA, Ruby, and other "scripting" type languages, that satisfied my impatient nature to, "do stuff now", vs getting lost in what seemed to be an endless pit of dependencies, includes, and compiler settings... it was like learning how to build the the tools and the toolbox they go in, when I just wanted to tighten a bolt, but I had to make the bolt too.
@mannyx2796
@mannyx2796 2 жыл бұрын
Very useful video implementing this into my game
@snork_games
@snork_games 7 жыл бұрын
First video I've seen of yours, sub earned!
@javidx9
@javidx9 7 жыл бұрын
Hey thanks 0x5E! I appreciate that!
@ayushman_sinhaa
@ayushman_sinhaa 3 жыл бұрын
Damn ! You explain things really well..
@12012004
@12012004 4 жыл бұрын
you are the best!!! Thank you for realeasing such great content
@alexandrelefebvre8627
@alexandrelefebvre8627 4 жыл бұрын
I really like the way you explain things. Always clean and simple (from a programmer perspective, should I say). Have you ever consider teaching ? Good work, by the way.
@javidx9
@javidx9 4 жыл бұрын
Thanks Alexandre! I have taught in the past, but decided to leave academia.
@emjizone
@emjizone Жыл бұрын
*Stacks of tiles are fun* because they make generating mazes look like solving mazes, but otherwise I don't see the point of *wasting computation time and energy* using them for maze generation. 1. You could link new tiles to the existing graph in *any fucking (or even non-fucking) arbitrary order,* including random and discontinuous, as long as you *mark each tile's branch* well, which can be done in a single step each time a tile is added. 2. Even if you want to go through the graph in a particular order for whatever reason of controlling the maze's properties (e.g. limiting the length of straight corridors, or the number of consecutive turns on the same side, or the distance between two branches, etc.), backtracking is *extremely quicker from one **_branching_** node to the next, than from any one tile to the next.* Feel free to prove me wrong, or to call me to work together on *amazing* 2D, 3D, nD maze generators and solvers.
@helicon2ify
@helicon2ify 7 жыл бұрын
Amazing and well detailed video ! since I found your channel, I start every morning with one of your videos ! Keep up the great work !
@javidx9
@javidx9 7 жыл бұрын
Hi Lukas, thanks, I hope I don't ruin your breakfast!
@adamodimattia
@adamodimattia 4 жыл бұрын
Question: why my display on this is squeezed horizontally? The x axis is much shorter then the y, I tested also on the source code. I’m running it on Windows on Mac, but with other tutorials from OLC I hadn’t had this problem (on the other hand I didn’t do that many of them). Is it a problem somehow related to my equipment? Of course it is not of utmost importance, the lesson itself is. But maybe someone has and idea? Maybe even the SENSEI HIMSELF? It is my favorite channel. Cheers!
@samuelmaucaille702
@samuelmaucaille702 7 жыл бұрын
Thanks! What a precious video!
@javidx9
@javidx9 7 жыл бұрын
Thanks Samuel, I'm pleased you found it useful!
@goat5249
@goat5249 4 жыл бұрын
I can't tell if you're faking going outside or being a programmer... Whichever it is, you are a good, my friend.
@ZaneDragonBorn
@ZaneDragonBorn 3 ай бұрын
Honestly, love the drawing teaching us how we can visualize this in effect. But as a new game dev to Unity and C#, this guide is quite hard to follow as CPP a quite different and the amount of usage of your engine makes it hard to understand what I am able to use and what I can't. Edit: Well actually this turned out to be quite great! Converted the github to C# using Copilot and with a bit of adjustment on my part. The code makes more sense now! Thx for the tutorial
@Ascendance2001
@Ascendance2001 4 жыл бұрын
Clicking on random videos cool to see this one in my recomended the first one you used OLC on
@foziljonofficial
@foziljonofficial 2 жыл бұрын
Hey , how are you ?! Please help me to do that : How to make road with utf-16 symbols at utf-16 maze in given input ?
@olegat
@olegat 4 жыл бұрын
Very cool :-) If I remember correctly I think that you can actually use a queue instead of a stack. Using a queue generates a maze using breath-first traversal, whereas the stack uses depth-first traversal. I would you have liked to see how different the maze looks with a queue instead of a stack :-)
@DFPercush
@DFPercush 4 жыл бұрын
std::list can push and pull from front or back, so you can use it as either a LIFO or a FIFO. Fork the repo and try it out. ;) Although, you might need additional state for each direction on each cell, because the history will be consumed after you take the first branch. I'm sure there are plenty of articles about doing something like that.
@skepat9426
@skepat9426 7 жыл бұрын
This is the DFS algorithm :)
@goodboiadvsp3297
@goodboiadvsp3297 4 жыл бұрын
Depth first search for those not binging maze videos rn
@jonathanmoore5619
@jonathanmoore5619 4 жыл бұрын
"The old pen and paper"... Like many others before you, your work will only be really appreciated when you stop. Until then. Thanks...
@chrisdiphoorn4915
@chrisdiphoorn4915 3 жыл бұрын
How about a 3D version of one of those table top mazes that you have a ball bearing that you need to move through and not allowed to drop in a hole?
@ddman12345678910
@ddman12345678910 7 жыл бұрын
loving these videos
@javidx9
@javidx9 7 жыл бұрын
Thanks Revi09!
@jonny5_
@jonny5_ 3 жыл бұрын
YES! You DIDN'T use 'system('cls')' to clear your console...thank you, sir!
@MasterOfMisc
@MasterOfMisc 4 жыл бұрын
2 mins to create a maze that would take him longer than 1 minute to solve. I see your a Christopher Nolan fan. :) Great video and content. I love how you explain these algorithms. I hope you plan on doing more algorithms.
@OneSaile
@OneSaile 6 жыл бұрын
this channel will have 70k subscribers by the end of 2018
@javidx9
@javidx9 6 жыл бұрын
Hi OneSaile, i love the optimism, but as long as people find it and the community useful Im happy.
@abandoned7501
@abandoned7501 6 жыл бұрын
@@javidx9 sadly but not =(
@joaocesarlima7339
@joaocesarlima7339 4 жыл бұрын
Great video! Thank you!
@monolyth421
@monolyth421 3 жыл бұрын
I learned about random number generators from a maze generating game on a DOS computer when I was 5
@shadowdragon7362
@shadowdragon7362 5 ай бұрын
I have implemented this algorithm in x86 assembly in tasm and it works wonderfuly! One problem I was having is that if the tracker runs into a backend and as soon as it is out of it it runs into a new dead end immediatly it will back track to the end of the dead end before it. Now it happens of course because it is the last cell being "discovered" as the last ones were just tracking back. while it does not interrupt the algorithm to make a wonderful maze. It does indeed interrupt other algorithms I would like to use with them. I would be happy for your advice or if I have done something wrong. Thank you!
@alexnovik6223
@alexnovik6223 2 жыл бұрын
It's a real appreciate video!!! Excellent explanation !!!
@alastairbowie
@alastairbowie 6 жыл бұрын
This vid was so cool and helpful. Cheers!!
@javidx9
@javidx9 6 жыл бұрын
Hey thanks Alastair!
@nickorsini7239
@nickorsini7239 4 жыл бұрын
Interesting adaptation of depth first search, would think to use it here.
@jensBendig
@jensBendig 4 жыл бұрын
Good explained!
@sayanghosh6996
@sayanghosh6996 4 жыл бұрын
24:32 "because we're using stack; thats really really complicated................... *one command* - done"😂😂😂
@neozoan
@neozoan 7 жыл бұрын
Your videos are very well made. Keep it up! :-)
@javidx9
@javidx9 7 жыл бұрын
Thanks Daniel!
@meridian974
@meridian974 3 жыл бұрын
this solution has a many long street without '+' type (cross) branching... I suppose that after 10-12 step randomly open new paralel counting thread :) And randomly open just reached dead end connecting with a neighbour cell... (so make a circuit path). :)
@warmdk9536
@warmdk9536 4 жыл бұрын
Thanks for the tips :D Great work!
@cedricfiege7880
@cedricfiege7880 5 жыл бұрын
Your videos are amazing !
@javidx9
@javidx9 5 жыл бұрын
Thanks Cedric!
@Nekonoaijin
@Nekonoaijin 3 жыл бұрын
If anyone runs into an issue with the Windows SDK headers and "byte ambiguity" while attempting to compile this code, or other code that calls on the Windows headers, the issue is that you are using C++17 and the 'std' namespace now defines 'byte', while the Windows headers helpfully also define a symbol called 'byte'. A simple fix that should work for anyone just following along with Javid is to move the 'using namespace std;' statement to be after any '#include' statement that brings in a header that relies on the Windows SDk headers. A more ambitious solution, but potentially problematic, is to "fix" the Windows headers (rename the 'byte' declaration to avoid ambiguity, e.g. BYTE or win_byte, etc). Problematic because they're not your headers, and you're basically creating a non-standard fork of them. And a sidestep to the issue is to make sure you use C++14, instead. This pre-dates the introduction of 'byte' to the 'std' namespace (and is why this issue did not surface earlier). In VS you do this by setting the project properties to the appropriate language variant (and globally defaulting to it, if you like).
@emjizone
@emjizone Жыл бұрын
2:15 You really *don't need to bother indexing tiles with index tuples* (one per dimension, so here: two). You can just as easily use *a single integer as a tile index*, regardless of the number of dimensions and the shape of the maze, as long as their *order* allows you to simply calculate the neighbor indexes. In general, this *saves unnecessary accesses* and runs faster (depending on your language and compiler).
@longjohn7992
@longjohn7992 3 жыл бұрын
You are a living GENUIS Pls do Bsp Trees Tutorial
@Komagb
@Komagb 4 жыл бұрын
Excellent video, loved it!
@Djinn667
@Djinn667 2 жыл бұрын
Back called on empty dequeue error. I don't know how I can fix this.
@bobbymarley5111
@bobbymarley5111 Жыл бұрын
Thank you for your fascinating video, it inspired me. 👍😃
@raphikingsley8078
@raphikingsley8078 2 жыл бұрын
please can someone explain how the enumerate function works applied to this?
What Is Assembly Language?
24:56
javidx9
Рет қаралды 456 М.
Coding Challenge #10.1: Maze Generator with p5.js - Part 1
16:05
The Coding Train
Рет қаралды 398 М.
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 1,7 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 2 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 87 МЛН
What School Didn't Tell You About Mazes #SoMEpi
12:49
mattbatwings
Рет қаралды 263 М.
Code-It-Yourself! First Person Shooter (Quick and Simple C++)
38:56
Maze Solving - Computerphile
17:15
Computerphile
Рет қаралды 1,1 МЛН
Procedural Generation: Programming The Universe
41:57
javidx9
Рет қаралды 206 М.
Path Planning - A* (A-Star)
31:18
javidx9
Рет қаралды 161 М.
Code-It-Yourself! Asteroids (Simple C++ and Maths!)
53:11
javidx9
Рет қаралды 171 М.