What's Recursion?

What’s recursion, and how can I use it? It sounds useful for repeated tasks, but I’m not sure what exactly it is and how I can implement it into gimkit creative.

1 Like

maybe you can do something like a wire that activates something then activates something else that when activated it will activate what activates the something I mentioned looping it :slight_smile:

got this from Google lol

the method of defining a function in terms of itself

recursion Is like repeating the same task
idk how to explain it

Think of it as opening a doll, and finding another doll inside, and opening that doll and finding another doll inside and etc…
Basically, you could use this feature as in chains.
For example, teleportation chains.

I found this amazing guide :3

2 Likes

To my knowledge, Tropicool is correct. It’s like defining a specific function, x() as x() = x()
This may be flawed, I’m not that good of a coder lol

So basically, recursion is the use of blocks repeating itself in channels. Recursion can be used for repeating blocks that need to be used throughout the whole game. Or simply something that needs to run until a certain condition is met.

Example

[1]
In this code, I have a randomizer, but with multiple outputs. I have set variables 1, 2, and 3, a random integer from 1 to 5. If 1, 2, or 3 get assigned the same value, it recurses, and reruns the code.


  1. I accidently used and, it’s supposed to be or. ↩︎

2 Likes