Difference between revisions of "Rnd"
Jump to navigation
Jump to search
Ray Chason (talk | contribs) m (Category: Random number functions) |
(Noted similarity to dice roll and cleaned up formatting) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:rnd}} | {{DISPLAYTITLE:rnd}} | ||
{{randomvariable|name=rnd(x)|graph=rnd.svg|caption=[[wikipedia:Probability mass function|Probability mass function]] of rnd(10).|distribution=[[Wikipedia:discrete uniform distribution|uniform]]|mean=<math>(x+1)/2</math>|stddev=<math>\sqrt{(x^2-1)/12}</math>}} | {{randomvariable|name=rnd(x)|graph=rnd.svg|caption=[[wikipedia:Probability mass function|Probability mass function]] of rnd(10).|distribution=[[Wikipedia:discrete uniform distribution|uniform]]|mean=<math>(x+1)/2</math>|stddev=<math>\sqrt{(x^2-1)/12}</math>}} | ||
− | rnd(x)<ref>{{function|rnd.c|rnd}}</ref> is a pseudo-random number function used in NetHack when a result should be unweighted. The range of values is between 1 and x inclusive (that is, 1 | + | '''rnd(<var>x</var>)'''<ref>{{function|rnd.c|rnd}}</ref> is a pseudo-random number function used in ''NetHack'' when a result should be unweighted. The range of values is between 1 and <var>x</var> inclusive (that is, 1 ≤ rnd(<var>x</var>) ≤ <var>x</var>). It is equivalent to rolling a [[D notation|die with <var>x</var> sides]]. |
==References== | ==References== | ||
Line 7: | Line 7: | ||
{{stub}} | {{stub}} | ||
− | |||
[[Category:Random number functions]] | [[Category:Random number functions]] | ||
+ | {{nethack-343}} |
Latest revision as of 06:26, 24 April 2020
rnd(x)[1] is a pseudo-random number function used in NetHack when a result should be unweighted. The range of values is between 1 and x inclusive (that is, 1 ≤ rnd(x) ≤ x). It is equivalent to rolling a die with x sides.
References
- This page is a stub. Should you wish to do so, you can contribute by expanding this page.
This page may need to be updated for the current version of NetHack.
It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.
Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.