Programming Mazes

187,325
0
Published 2017-07-10
I'm tired, hot and sun-burnt, holidays are never that relaxing. Anyway, here I introduce one of my favorite algorithms - the Recursive Back-tracker, to generate a maze. I love how perfectly complete this algorithm is, it can be used in all situations where you need to guarantee your network has all paths traversed. It's also my first video with the olcConsoleGameEngine class, so it's a bit of an experiment.


GitHub: github.com/OneLoneCoder/Javidx9/blob/master/Consol…

Blog: www.onelonecoder.com/

All Comments (21)
  • @Jetpans
    Now the man makes an algorithm to solve your maze in under 1 minute. The everlasting competition of coders.
  • @marksandles259
    just discovered your channel today... Don't normally write in comments sections... but.. really enjoying your videos. please continue the good work.
  • @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 👍
  • @FinBoyXD
    I dont believe you did that in two minutes.
  • 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!
  • @_rubikz_
    This channel is a hidden(unfortunatly) gem , keep up the great work :D
  • @iMamoMC
    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! ^^
  • @weisjerry
    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.
  • @haltarys
    "Two minutes to create a maze that would take one minutes to solve" ? That's a line from Inception !
  • @didaloca
    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.
  • @Drogba402
    This channel deserves more subscribers
  • @nailbomb420
    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 :)
  • @T3RRY_T3RR0R
    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.
  • As always, i cant believe this video has "only" 300 views. Keep up the awesome work!
  • @Codejoy
    One of my more favorite videos I have seen. Subscribed a while ago, just a really enjoyable view, everyone of these !
  • @oliverdacracker
    This is the greatest YouTube channel that I have had the pleasure to stumble upon.
  • @udoc.7528
    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.
  • 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.
  • @altheahicks9574
    Hey, just want to say thanks! I've learned so much from your videos, and continue to learn more.