True Random Generation | Theory

Wouldn’t recursive backtracking also work?

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.

3 Likes

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.


The missing piece of code at the button was just me trying to convert xstartPos and ystartPost into text.

I thought this would work, but whenever I step on it, entire rows and columns get deactivated. Does anyone know what’s wrong?

PS. I randomized only 2 and 4 because y for now would end up being -2, and that isn’t an existing coordinate yet on my grid.


  1. X had 2 and Y had 0 to make a coordinate of (2,0). The starting point. ↩︎

5 Likes

That’s because you need to have one deactivated to start, or else it will loop around and deactivate everything.

2 Likes

So I have the starting point deactivated?

2 Likes

Exactly.
If that doesn’t work, maybe try some other methods.

Maze generation - Rosetta Code

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…

4 Likes

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?

2 Likes

Doesn’t really matter.

2 Likes

Scratch that. Somehow…it worked!

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.

5 Likes

Can you send a gif, that’s very cool!
You are probably the first to do this in Gimkit!

1 Like

Do you want a gif of it working, or not working?

3 Likes

With it working.

Wow, you are litterally a new Blackhole!

4 Likes

Ok, gimme a sec. I’ll try getting a gif ready.

Sorry, still trying to figure out how to make a gif. Don’t worry, I’m using a guide. :smile:

2 Likes

I can’t figure out how to end the gif. I start it, but then there isn’t any button to end it.

Thanks, I’ll try out that website.

2 Likes

I normally use video maker on Canva as all other gif making websites take longer than 2 hours [1], but Canva has a great video editor that is quick

[1]. exaggerated? I think not.

2 Likes

Gifs are on loop.
That’s alright, though.

2 Likes

Wait, how do you make gifs on it? I’m so sorry if I’m asking too many questions, I don’t make gifs so this is hard for me. :sweat_smile:

1 Like

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.

3 Likes

Do you know any good websites for recording? I’ve tried 3 and my video lagged so hard.

Chromebook.

1 Like

Depends, what computer do you use?

Edit: Then do the keybind ctrl + shift + view desk

The view desk key is 4 keys away from the esc key.

Edit: That’s fine!

2 Likes

I almost have it, I just need to make it smaller. Sorry for the long wait…
Screen recording 2024-12-26 3.58.05 PM
Finally got it @Quack_Quack

1 Like