random

(random [lower bound] [upper bound] [list] [cons pair])


Description:

There are a number of forms of random but each returns a random number see examples for examples


Arguments:

    upper-bound -- exclusive upper bound to choose from

    lower-bound -- inclusive lower integer to choose from

           list -- choose random element from list

      cons pair -- weighted cons pairs


Returns: boolean


Examples:

(random)                           => 0.579

(random 5)                         => 4

(random 5 10)                      => 7

(random '(a b c))                  => b

(random (cons 0.3 a) (cons 0.7 b)) => b



Back to index