advr.hlp (Topic list)
RANDOMIZE Statement, RND Function Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 RANDOMIZE [seed]
 RND[(n)]
 
 Usage Notes
   ■ If the random-number generator is not reseeded, the RND function returns
     the same sequence of random numbers each time the program is run. To
     avoid this, place a RANDOMIZE statement at the beginning of the program
     loop and change the argument with each iteration.
 
   ■ A convenient way to initialize the random-number generator is to use the
     TIMER function. Using TIMER ensures a new series of random numbers.
     See: TIMER Function
 
   ■ To produce random integers in a given range, use this formula:
 
         INT ((upperbound - lowerbound + 1)*RND + lowerbound)
 
     where upperbound is the highest number in the range, and lowerbound is
     the lowest number in the range.