MCPcopy Index your code
hub / github.com/NetHack/NetHack / rnd

Function rnd

src/rnd.c:154–165  ·  view source on GitHub ↗

1 <= rnd(x) <= x */

Source from the content-addressed store, hash-verified

152
153/* 1 <= rnd(x) <= x */
154int
155rnd(int x)
156{
157#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
158 if (x <= 0) {
159 impossible("rnd(%d) attempted", x);
160 return 1;
161 }
162#endif
163 x = RND(x) + 1;
164 return x;
165}
166
167int
168rnd_on_display_rng(int x)

Callers 15

amii_player_selectionFunction · 0.85
mkshopFunction · 0.85
mk_zoo_thronemonFunction · 0.85
mkundeadFunction · 0.85
squadmonFunction · 0.85
dotwoweaponFunction · 0.85
fruitaddFunction · 0.85
resist_conflictFunction · 0.85
moveloop_preambleFunction · 0.85
allmain.cFile · 0.85
newpwFunction · 0.85
mk_mplayer_armorFunction · 0.85

Calls 2

RNDFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected