Files
nethack/doc
PatR cbdda9dc9d adopt github pull request #286 - rndmonst()
Eliminate the cache that was supporting rndmonst() and pick a random
monster in a single pass through mons[] via "weighted reservoir
sampling", a term I'm not familiar with.

It had a couple of bugs:  if the first monster examined happened to
be given a weighting of 0, rn2() would divide by 0.  I didn't try
to figure out how to trigger that.  But the second one was easy to
trigger:  if all eligible monsters were extinct or genocided, it
would issue a warning even though the situation isn't impossible.

Aside from fixing those, the rest is mostly as-is.  I included a bit
of formatting in decl.c, moved some declarations to not require C99,
and changed a couple of macros to not hide and duplicate a call to
level_difficulty().

Fixes #286
2020-02-22 17:40:55 -08:00
..
2018-11-11 10:29:52 -05:00
2020-02-15 13:08:34 -08:00
2018-04-25 16:54:50 -04:00
2018-09-21 16:36:38 -04:00
2018-09-21 18:12:42 -07:00
2018-09-21 18:12:42 -07:00
2018-04-25 16:54:50 -04:00
2018-09-21 18:12:42 -07:00
2018-09-21 18:12:42 -07:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2018-09-21 18:12:42 -07:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2003-05-11 13:40:01 +00:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 16:54:50 -04:00
2018-09-21 18:12:42 -07:00
2019-05-09 17:15:14 -07:00
2020-01-13 15:30:23 -05:00
2016-06-19 19:52:28 -04:00
2020-02-15 14:42:00 -08:00
2020-01-01 11:59:43 -05:00
bit
2020-01-27 14:44:29 -05:00
2018-11-11 10:29:52 -05:00
2018-11-11 10:29:52 -05:00
2020-01-19 23:09:53 -05:00
2018-04-25 16:54:50 -04:00
2018-09-20 18:02:48 -04:00
2019-11-14 08:20:38 -05:00