Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>rnd random number</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
RND                      Random Number

 y = RND [(n)]

    Generates a single-precision pseudo-random number in the range of 0 to
    1.

           n    A numeric expression.

   -------------------------------------------------------------------------

      Notes:    If n is omitted or is positive, RND returns the next
                random number in the current sequence.

                If n is 0, RND returns the last (most recent) random
                number in the current sequence.

                If n is negative, BASIC uses n to reseed the random number
                function. The first number in the reseeded random number
                series is returned.

                To produce random integers in the range 1 to Max, use the
                following formula:

                    newRandom% = INT (RND * Max) + 1

See Also: RANDOMIZE

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson