rollDie

Roll a die with a number of sides

int
rollDie
(
int sides
)

Parameters

sides
Type: int

Number of sides on the die to roll

Return Value

Type: int

The result of the roll as a float

Examples

1 auto rolled = rollDie(6);
2 assert(rolled > 0);
3 assert(rolled < 7);
4 
5 rolled = rollDie(20);
6 assert(rolled > 0);
7 assert(rolled < 21);

Meta