Die()

From TinyMUX
Revision as of 05:02, 17 January 2006 by Ian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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