Random with Range

Discuss Lemur and share techniques.
Post Reply
jeremyz
Newbie
Posts:14
Joined:24 Feb 2013 19:07
Random with Range

Post by jeremyz » 13 May 2015 01:19

Hello

Is there something like this: randRange(0,6) which would return values between 0 to 6?

I know I can do 'rand()*6' but curious if that function exists.

Thanks!
JZ

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Random with Range

Post by Softcore » 13 May 2015 09:52

No there is no such built in function...

And in case you want integers between 0 and 6 then you ll go:

decl val=round(rand()*6);

jeremyz
Newbie
Posts:14
Joined:24 Feb 2013 19:07

Re: Random with Range

Post by jeremyz » 15 May 2015 02:23

Thanks for the response Softcore.

-j

Post Reply