Skip to main content

roll_MdN

Discworld driver help

roll_MdN

Name

roll_MdN() - This efun rolls a bunch of dice to get a nice weighted medium.

Synopsis

int roll_MdN( int dice, int sides )

Description

This efun simulates the rolling of `dice' dice, each with `sides' sides. It returns the sum of such a throw, which will be a weighted medium.

The value returned ranges from `dice' to `dice * sides', with `dice * ( sides + 1 ) / 2' as most frequent value.

Example 1

roll_MdN( 3, 6 );
roll_MdN( 1, 20 );

See also

random(), shuffle(), element_of()