-
Random expression with exceptions
I didn’t find my answer on the web nor here so I’m asking directly :
I’d like to make a random expression which goes from 1 to 10 for instance but with exceptions like 2, 4 and 6. These exceptions could be changing so this is why I’m not doing a random expression based only on the other numbers.I tried to achieve it using if/else statements :
If random number = exception 1 add 1 to it
but first it’s quite messy and there are many flaws especially with several exceptions.Are you aware of a more efficient way?
Have a great weekend
UPDATE : I found the “while” statement could be, theoretically, the solution by looping the random expression until it gives a correct value, but when I use in AE, AE turns veryyy slow or even doesn’t calculate it due to a Timeout while waiting for the engine.