Page 1 of 1

Getting a random number range

Posted: Mon May 08, 2017 4:27 am
by mort
I've spent 35 years programming in text and even animate text with using a print locate with loops that give the illusion the text is moving. Now I'm wanting learn graphics and animate with the help of the RND(x) statement. But I'm not seeing a way to generate a number between a range of numbers. Let's say between 500 and 1000. The RND(x) statement always generates from 0 to 1000 if x is 1000.
Anyone have a work around without adding IF/THEN to make it do over until the number falls between 500 to 1000? Many thanks.

Mort

Re: Getting a random number range

Posted: Mon May 08, 2017 4:41 am
by Mr. Kibernetik
X=500+RND(500)

Re: Getting a random number range

Posted: Mon May 08, 2017 5:51 am
by mort
That was so simple I must have programmer block. Thank you very much.

Mort