flatline, I think you've got to randomize the range and then adjust for your min.
ie. RND(10)+10 to get something between 10 and 20.
P#34713 2017-01-02 02:15 ( Edited 2017-01-02 07:15)
I've been using these:
-- range function rndr(a,b) -- min,max if (a>b) a,b=b,a -- sanity check return a+rnd(b-a) end -- around a value function rnda(c,r) -- center, radius r=abs(r) -- sanity check return c-r+rnd(2*r) end |
you can remove the sanity checks for better performance if you have full control on the parameters
(calling rnd() with a negative number seems to yield a full range number, from -32768 to 32767)
P#34731 2017-01-02 07:57 ( Edited 2017-01-02 12:57)
[Please log in to post a comment]