Documentation Prolog Predicate Reference random random/3


Generate random value in a range.


random( +integer, +integer, -integer )
random( +float, +float, -float )

random(Begin, End, Random) generates a random value Random. If Begin and End are both integers, Random will be an integer as well in the range [Begin, End). If either Begin orEnd are floats, Random will be a float too in the range (Begin, End). In order to generate a random integer in a range, the use of random_between/3 is encouraged.