[futurebasic] Re: RANDOM QUESTION

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

From: Jason Conkey <jconkey@...>
Date: Sun, 21 Dec 1997 10:44:44 -0800
I usually only call RANDOMIZE once in my program, as below for example:

WINDOW 1
RANDOMIZE TIMER

LOCAL FN RandomNumbers
  DIM a

  FOR a=1 TO 10
    PRINT RND(100)
  NEXT
END FN

FN RandomNumbers

DO
UNTIL FN BUTTON
END

This gives me random-enough numbers.  Does this answer your question, or
were you talking about the RND function not working right?

HTH,
Jason

>On Fri, 21 Nov 1997, Arcnon wrote:
>
>> I have a old version of future basic so you may have to look in
>> retrospect to answer my question.
>>
>> I am try to generate a random number inside a function and it appears
>> that the random statement doesn't "reset" the seed on a loop inside the
>> fn.  Does anyone know off hand what I am doing wrong.
>>
>
>I'm not sure about this, perhaps if you post some code it would make the
>question a litle easier to answer.  Since i don't know exactly what you're
>trying to do, I don't know if this will suit your needs.  It sounds like
>you're trying to get several random numbers.  If you are, you can make the
>seed a variable in a FOR loop.  If you're trying to call the function on
>several different occasions, than one method is to use the seconds on the
>clock as a random seed.
>
>> jeff
>> --
>> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>
>>
>
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>