Need help with RANDOMIZE/RND
Author Message
Need help with RANDOMIZE/RND

Quote:

>..I want to use the command RANDOM or RND command to ..
>but I can't find out how to do it..

Use 'RANDOMIZE once to start a series of (pseudo) random numbers.
Subsequent calls to RND gives (pseuso)random numbers 0 - 1.
You can convert this range to an integer range:

RANDOMIZE
for i = 1 to 100
print INT(RND * 1000); ' will give numbers 0 - 999
next i

Dave C.

Tue, 06 Jul 1999 03:00:00 GMT
Need help with RANDOMIZE/RND

I am trying to make a program that prints a list of randomly selected
destinations and distances. I want to use the command RANDOM or RND command
to select destinations/distances, but I can't find out how to do it. I want
the user to first enter a "seed" and then the random number should be

Regards,

Torje Str?m Evensen
--
"My grandfather used to say that a fella's life wasn't
worth mentioning if he hadn't shared with some people
along the way"
---Macgyver, giving his birthday speech

Tue, 06 Jul 1999 03:00:00 GMT
Need help with RANDOMIZE/RND

Quote:

> I am trying to make a program that prints a list of randomly selected
> destinations and distances. I want to use the command RANDOM or RND command
> to select destinations/distances, but I can't find out how to do it. I want
> the user to first enter a "seed" and then the random number should be

> Regards,

> Torje Str?m Evensen
> --
> "My grandfather used to say that a fella's life wasn't
> worth mentioning if he hadn't shared with some people
> along the way"
> ---Macgyver, giving his birthday speech

Why not use the system time as a seed,
ie.

Randomize timer

then assign variables...

You could use dimensional array variables to store the destinations...

dim dest\$(20)  'sets up the variable 'space'

either store one by one;

let dest\$(1)="Tokyo"
let dest\$(2)="Montreal"

etc.

for n=1 to 20
next n

data "Tokyo","Montreal",etc....
(data at end of program...

I hope this helps...

Greg  :)

Tue, 06 Jul 1999 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages