blob: a744312e090b8102b07f82fe55384a8a5182dfbf [file] [log] [blame]
Zesstrab6ac9f62020-01-21 11:11:16 +01001SYNOPSIS
MG Mud User88f12472016-06-24 23:31:02 +02002 int random(int n)
3
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
5 Returns a number in the random range [0 .. n-1].
MG Mud User88f12472016-06-24 23:31:02 +02006
Zesstra715ec202025-07-09 22:18:31 +02007 The random number generator is proven to deliver an equal distribution
8 of numbers over a big range, with no repetition of number sequences
9 for a long time. The downside of these (desirable) qualities is that
10 when generating numbers in a small range over short time, certain
11 numbers will appear far more often than others.
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 The only solution is the implementation of a special simul_efun which
14 takes special steps to implement an equal distribution over small
15 ranges and short times.