Maze generation with recursive backtracking algorithm

  Рет қаралды 24,791

Ferenc

Ferenc

Күн бұрын

How to generate a maze with recursive backtracking method.
github.com/fer...

Пікірлер: 40
@PunmasterSTP
@PunmasterSTP Жыл бұрын
This would have been an amazing screen saver in the 90s. Anyway, it’s still really cool now 👍
@tentyp2
@tentyp2 Жыл бұрын
you do know how screen savers worked right
@PunmasterSTP
@PunmasterSTP Жыл бұрын
@@tentyp2 Yeah, you need either blackness or changing colors to avoid burning colors into the CRT. Just saying, it looks a bit similar…
@tentyp2
@tentyp2 Жыл бұрын
@@PunmasterSTP yeah, would have worked if it went on forever and if the white spaces would fade after like 10 seconds
@christopherherdinqromex6369
@christopherherdinqromex6369 Жыл бұрын
This one has the best results of all the ones you've uploaded, I think
@CorrinWyndryder
@CorrinWyndryder Жыл бұрын
I once wrote an ios app that used this algorithm to generate mazes. Unfortunately I was too inexperienced to put the recursive method in a parallel thread so it would make the game seem like it crashed as it loaded more and more complicated levels. I'm experienced enough now to know how to run it recursively with the frame rendering output and assign it a task bar. I just don't have the time to make it.
@tripslord9029
@tripslord9029 Жыл бұрын
2:11 amogus generator
@bentosboringlife893
@bentosboringlife893 Жыл бұрын
Hell yeah
@upchessbyabzolute
@upchessbyabzolute 7 ай бұрын
💀
@asdfghyter
@asdfghyter Жыл бұрын
i believe this algorithm guarantees that there are no four way intersections, but i may be mistaken *Edit:* I was mistaken!
@jamalak3472
@jamalak3472 Жыл бұрын
Foud one four way intersection
@coppertones7093
@coppertones7093 Жыл бұрын
it generates one at 2:28
@asdfghyter
@asdfghyter Жыл бұрын
@@coppertones7093 I see, I was mistaken, thank you! It does seem to make them very rare though.
@mspeir
@mspeir Жыл бұрын
It's guaranteed to make what is known as a "perfect maze". It will not have loops or unreachable cells.
@asdfghyter
@asdfghyter Жыл бұрын
@@mspeir well that’s a pretty low bar and even the “binary tree” algorithm that produces super ugly mazes satisfies that kzbin.info/www/bejne/goG3Xqp_idF-o80
@bottlekruiser
@bottlekruiser Жыл бұрын
0:58 amogus ඞඞඞඞ
@lillyroths3944
@lillyroths3944 Жыл бұрын
It's not funny it's just a cool game, it's getting old too.
@ridvangonca
@ridvangonca Жыл бұрын
@@lillyroths3944 it still sus ඞ
@bottlekruiser
@bottlekruiser Жыл бұрын
@@lillyroths3944 cope ඞ
@kaan8964
@kaan8964 Жыл бұрын
@ReallyFeelingIt8888quads
@ReallyFeelingIt8888quads Жыл бұрын
2:11 baby amogus :D
@goldsaturn1436
@goldsaturn1436 Жыл бұрын
0:56 sus
@minhphantrannhat9081
@minhphantrannhat9081 Жыл бұрын
GET OUT OF MY HEAD
@letronix6243
@letronix6243 Жыл бұрын
amazeing
@thezouave7636
@thezouave7636 Жыл бұрын
youtube what's with the sudden promotion of these videos?
@joansparky4439
@joansparky4439 Жыл бұрын
I'm 2 weeks behind you 🥴
@sailor5853
@sailor5853 Жыл бұрын
That's a good maze, took me more than 10 seconds
@furiouspusher1756
@furiouspusher1756 9 ай бұрын
Imagine solving this with the right-hand rule.
@nerdy8644
@nerdy8644 Жыл бұрын
How does this work? I don’t understand the algorithm
@xXFluffers
@xXFluffers Жыл бұрын
The red line goes in random directions until it hits a wall, then backtracks until it can branch off again, going in random directions until it hits another wall.
@nerdy8644
@nerdy8644 Жыл бұрын
@@xXFluffers how are the walls created?
@christopherherdinqromex6369
@christopherherdinqromex6369 Жыл бұрын
​@@nerdy8644 Rather, the red line goes in any random directions as long as it doesn't hit a wall or itself or until it hits a dead end, a dead end being three walls, one to the left, one to the right and one to the front of the red lines head. The walls can be either a line made previously by the red line or the edge of the area the maze is to be made in. Once it hits a dead end, it backtracks along the red path it just made, turning it white, until it finds to the left or the right of the path an empty square, and then it goes there, branching off into another red path. Continuing the cycle, you fill up the whole screen without loops in the maze or paths that cannot be accessed. It is quite clever!
@overratedprogrammer
@overratedprogrammer Жыл бұрын
​@@christopherherdinqromex6369 Unfortunately I don't understand how walls work. I made it so that it goes through every cell and marks it as visited, and backtracks if it has no valid move, but I have no idea how I'm supposed to make the walls. I saw a youtube video where a guy just draws over the wall with the path color but I think I kinda need more than that since this is going to be a game
@shalevforfor5550
@shalevforfor5550 15 күн бұрын
This algorithm has the best result but it's too slow like try to generate a maze of 200x200 in JS it's taking time in python that will take ages
@Louis_Marcotte
@Louis_Marcotte Жыл бұрын
My brain is broken. At 0:55 an amogus forms on the left, it remains until 2:07
@Cheesy_33
@Cheesy_33 Жыл бұрын
illegal game of Snake
@Lightstarling
@Lightstarling Жыл бұрын
Sus
Maze generation with Prim's algorithm
1:37
Ferenc
Рет қаралды 19 М.
Maze Solving - Computerphile
17:15
Computerphile
Рет қаралды 1,1 МЛН
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 46 МЛН
大家都拉出了什么#小丑 #shorts
00:35
好人小丑
Рет қаралды 83 МЛН
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 6 МЛН
Programming Mazes
27:11
javidx9
Рет қаралды 193 М.
A Comparison of Pathfinding Algorithms
7:54
John Song
Рет қаралды 715 М.
Backtracking (Think Like a Programmer)
13:02
V. Anton Spraul
Рет қаралды 327 М.
Countries which used to be way bigger
6:11
Geostatz Productions
Рет қаралды 77 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Coding Challenge #10.1: Maze Generator with p5.js - Part 1
16:05
The Coding Train
Рет қаралды 396 М.
Python Maze Generator. Depth-First Search
5:38
Coder Space
Рет қаралды 20 М.
Annoying maze billiard
2:04
Alexander Gustafsson
Рет қаралды 28 М.
Part 24
1:23
Mazes
Рет қаралды 16 М.
Sounds of the Mandelbrot Set
9:32
CodeParade
Рет қаралды 2,8 МЛН