POSITION:028,114
COLOUR:STANDARD
TEXT:00,Euphoria has a library routine that may be of interest to those who want
TEXT:16,to write their own games. It involves the creation of random numbers, a
TEXT:16,key element in any game, whether it involves randomly generating a number
TEXT:16,to guess, or creating an unexpected malfunction aboard a spaceship during
TEXT:16,a critical moment in battle. Here is the syntax of the rand() library
TEXT:16,routine:
COLOUR:EUPHORIA
TEXT:32,   = rand( )
COLOUR:POINTS
TEXT:00,ro        o
COLOUR:STANDARD
TEXT:32,rand() will return a randomly generated number. If   is an atom value,
COLOUR:POINTS
TEXT:00,                                                   o
COLOUR:STANDARD
TEXT:16,the number generated will be from 1 to  . If   is a sequence, the number
COLOUR:POINTS
TEXT:00,                                       o     o
COLOUR:STANDARD
TEXT:16,generated will be from a sequence composed of 1's to  . A randomly
COLOUR:POINTS
TEXT:00,                                                     o
COLOUR:STANDARD
TEXT:16,generated sequence value will always have the same length as  . The
COLOUR:POINTS
TEXT:00,                                                             o
COLOUR:STANDARD
TEXT:16,largest integer value (either passed as a single atom or as one or more
TEXT:16,elements of a sequence) rand() will generate is 1,073,741,823. A demo
TEXT:16,program is available to show rand()'s use in a guess the number game.
