Getting a random number range

Post Reply
mort
Posts: 4
Joined: Wed May 03, 2017 9:29 pm
My devices: iPad Pro
Flag: United States of America

Getting a random number range

Post 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
:-D

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Getting a random number range

Post by Mr. Kibernetik »

X=500+RND(500)

mort
Posts: 4
Joined: Wed May 03, 2017 9:29 pm
My devices: iPad Pro
Flag: United States of America

Re: Getting a random number range

Post by mort »

That was so simple I must have programmer block. Thank you very much.

Mort
:-D

Post Reply