rn1

From NetHackWiki
Revision as of 17:35, 19 March 2022 by Cathartes (talk | contribs) (update ref to 3.6.6; de-stub since there's really not much that can be written about this)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
rn1(x,y)
Distribution uniform
Mean x − 12 + y
Standard deviation sqrt(x2 − 112)
Not to be confused with rnl.

rn1(x, y)[1] is a pseudo-random number macro used in NetHack when a result should be unweighted. It is equivalent to rn2(x) + y. The range of values is between y and y + x − 1 inclusive (that is, y ≤ rn1(x,y) < x + y).

See also rn2.

References