Discuss Scratch

bigoof33
Scratcher
4 posts

random non repeating number generator

does anyone know of a way to make a rng that doesn't repeat?
what I want is a rng that generates a number and then will not repeat the previous number. I also do not want the rng to STOP generating number.

thanks
CookingAndCars
Scratcher
29 posts

random non repeating number generator

foreversetVariabletopickrandom1towhateveryouchooseifnotlistcontainsVariable?thenaddVariabletolist

How about this? Also, instead of forever, you could use repeat blank times

Last edited by CookingAndCars (Dec. 22, 2018 23:48:20)

CookingAndCars
Scratcher
29 posts

random non repeating number generator

Okay, just updated post. Messed up on code
bigoof33
Scratcher
4 posts

random non repeating number generator

lol
bigoof33
Scratcher
4 posts

random non repeating number generator

I don't really know how that would work in my case, can you check out the project? its called omega flowey 0.4

the way the rng works is that it broadcasts a random number between 1 and 5 that corresponds to an “attack” and then the projectile receives it and plays the attack. the problem is (if you haven't already noticed) is that when an attack repeats itself, it copies itself or something weird and then the game lags a bunch…

dimitrip
Scratcher
500+ posts

random non repeating number generator

Hi.
Wouldn't this be sufficient for you?
Greetz,
Dimitri
bigoof33
Scratcher
4 posts

random non repeating number generator

wow thanks! the only thing that is wrong is that I think attack 4 and 5 cannot happen after each other or something, but I can easily fix that. thanks again

Powered by DjangoBB