TinyMUX

Die()

Functions

Description

FUNCTION: die(number of times to roll die, number of sides on die)

This function simulates rolling dice. It “rolls” a die with a given number of sides, a certain number of times, and sums the results.

Related Topics: lrand(), pickrand(), rand(), shuffle()

Examples

Roll 1d6

> say die(1, 6)

You say, “3”

> say die(1, 6)

You say, “6”

Roll 42d42

> say die(42, 42)

You say, “723”

(–Soylent 01:19, 3 December 2005 (EST))