MCPcopy Create free account
hub / github.com/NetHack/NetHack / flip_level_rnd

Function flip_level_rnd

src/sp_lev.c:966–982  ·  view source on GitHub ↗

randomly transpose top with bottom or left with right or both; caller controls which transpositions are allowed */

Source from the content-addressed store, hash-verified

964/* randomly transpose top with bottom or left with right or both;
965 caller controls which transpositions are allowed */
966void
967flip_level_rnd(int flp, boolean extras)
968{
969 int c = 0;
970
971 /* TODO?
972 * Might change rn2(2) to !rn2(3) or (rn2(5) < 2) in order to bias
973 * the outcome towards the traditional orientation.
974 */
975 if ((flp & 1) && rn2(2))
976 c |= 1;
977 if ((flp & 2) && rn2(2))
978 c |= 2;
979
980 if (c)
981 flip_level(c, extras);
982}
983
984
985staticfn void

Callers 3

wiz_flip_levelFunction · 0.85
lspo_finalize_levelFunction · 0.85
load_specialFunction · 0.85

Calls 2

rn2Function · 0.85
flip_levelFunction · 0.85

Tested by

no test coverage detected