I want to do like this: the counter do a random value of 0-10 but never be 7 for example. How do i do that in the same expression?
Printable View
I want to do like this: the counter do a random value of 0-10 but never be 7 for example. How do i do that in the same expression?
One way is to have a counter/global/alt value serve as a holder for the number you don't want and if your randomized value equals that number you make a new randomizer. Might be better ways but that's what i came up with on the spot :-)
hmm... but how do i do to put in the expression is the number that i don't want, do it again?
The best I can come up with is this: Val(Mid$("00010203040506080910", Random(10) * 2, 2))
That's actually a brilliant approach Popcorn!
Holy crap, that IS pretty clever!
I was going to say simply add 1 to the result if it is 7. That makes 8 have a slightly higher chance of being the number, but probably not too bad.
String functions in Fusion are great and can be a lifesaver sometimes. See also this thread with a similar random number problem:
http://community.clickteam.com/threads/92505-Random-number-without-last-number-(It-s-possible-)-(random-counter
Thank you for helping Popcorn. But still it repeats the value in a row. :\