powered by
Simulate throws with one or multiple fair dice with an arbitrary number of faces.
throw_dice(n, faces = 6L, dice = 1L)
an integer vector of length n with the results of the throws.
n
number of throws. The value is cast to integer.
the number of faces of the dice. The value is cast to integer.
the number of dices to use for each throw. The value is cast to integer.
# throw a single 6-sided dice 5 times throw_dice(5) # throw a single 20-sided dice 7 times throw_dice(7, faces = 20) # throw two 6-sided dice 9 times throw_dice(9, dice = 2)
Run the code above in your browser using DataLab