Simulate throws with one or multiple fair dice with an arbitrary
number of faces.
Usage
throw_dice(n, faces = 6L, dice = 1L)
Arguments
- n
number of throws. The value is cast to integer.
- faces
the number of faces of the dice. The value is cast to integer.
- dice
the number of dices to use for each throw. The value is
cast to integer.
Value
an integer vector of length n
with the results of the throws.
Examples
# throw a single 6-sided dice 5 times
throw_dice(5)
#> [1] 4 3 3 2 4
# throw a single 20-sided dice 7 times
throw_dice(7, faces = 20)
#> [1] 4 5 1 7 6 10 15
# throw two 6-sided dice 9 times
throw_dice(9, dice = 2)
#> [1] 4 10 11 7 4 8 5 7 10