[futurebasic] Re: RANDOM QUESTION

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Mon, 22 Dec 1997 20:06:25 -0600
Jason wrote:
> Rick, after reading your post, I thought, if the RANDOMIZE statement is
> being used inside a loop that could explain the problem:
> FOR a=1 to 20
>   PRINT RND(100)
> NEXT a
> If RANDOMIZE was called more than once per tick, and RND is also called
> then the numbers would be the same within the same tick.  The RANDOMIZE
> statement resets the "random" sequence each time it is called, so if you
> use it a fast loop, you will reset to the beginning of the same sequence
> over and over, thus RND will give the same number each time, until the tick
> value changes.

That makes sense.  For some reason I thought that Arcnon was saying that
he(she?) wanted to repeatedly generate the _same_ sequence of random
numbers, and was having trouble resetting the seed so that it would do
that.  On a re-reading of the message, I'm not sure where I got that
impression.  Guess I should wear my glasses when I read my e-mail :-)

- Rick