D (function)

From NetHackWiki
Jump to navigation Jump to search
d(n,x)
Probability mass function of d(3,6) and probability density function of the normal distribution with the same mean and standard deviation.
Distribution normal (if n > 1)
Mean n*(x+1)/2
Standard deviation n*(x21)/12

d(n,x)[1] is a pseudo-random number function used in NetHack to simulate the rolling of multiple dice. The range of values is between n and n*x inclusive (that is, n ≤ d(n,x) ≤ n*x). It is equivalent to ndx in D notation, or rolling n independent dice with x sides each and summing the results.

References

This page is a stub. Should you wish to do so, you can contribute by expanding this page.