I’m trying a sort an expression to compare two specific values from a single rand() call like this
(rand(0,3) == (0 || 2) ? 100 : 0)
but it doesn’t work. Is there a way to compare two specific values returned from a single rand() call?
(rand(0,3) == 0 || rand(0,3) == 2) ? 100 : 0
…isn’t any good as that then uses two rand() calls which could obviously, and probably will, return 2 different numbers.
Any one got any ideas please?
I’ve just thought of something, and will give it a try…
(rand(0,3) < 2 ? 100 : 0)
This is working for my needs, for now, by using 0 and 1 rather than 0 and 2. But if I actually need the values 0 and 2, it will fail. So, is there a way to check for 2 specific values from a rand() call?.