Recursive generation works like it has a starting point, then it randomly advances to an unvisited neighbor and keep doing this until it reaches a dead end, then it backtracks to the last place it had unvisited neighbors and continues there. Since it needs to have a memory to be able to identify which grids were visited or not, it’s a way through this problem.
Ok, I’ve run across a problem. In my time trying to make recursive backtracking, I’ve hit a major bump.
Right now, what I’ve made is a grid with walls surrounding each cell, each cell has a coordinate and deactivates on that coordinate. The idea was when the program advances on a cell, it would broadcast the coordinates and deactivate the cell as a path.
So, after making the grid, I made an x and y number property and wrote the coordinates. [1]
Anyways, my idea was that we’d randomize numbers to decide how the coordinate advances, since I’m just starting, I didn’t want to worry about the system identifying if the cell had been visited yet. Here’s my block code so you can see.
Task Generate and show a maze, using the simple Depth-first search algorithm. Start at a random cell. Mark the current cell as visited, and get a list of its neighbors…
Quick question, can I just click the option ‘have this barrier deactivated on game start?’
Or do I have to deactivate through the block code in the trigger?
I made a smaller grid, this time without walls. At first, the same thing happened. But as I was scrolling through my channels, I didn’t see any 8,0, 7,6 which I had place to deactivate the barriers. This sparked the idea to try to do it without commas, I tried it with the smaller barrier, and it worked! It was advancing only once!
I think commas don’t work in the broadcast channel, as I only had 0 1 2 3 4 5 6 7 8 as my channels. Which might be the reason entire rows and columns were removed. They had the same broadcast channels.
That’s fine!
You just record a video and upload it on the Canva video editor.
It will automatilcally make the video the length of the recording.
Then, just download it as a gif, but make sure to make the quality lower because there is a maximum file size limit on the Forums.
Also, make sure not to make the video too long, because of the maximum file size limit.