Die()

From TinyMUX
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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))