I wrote this code in R and I would like to optimize (write the for loop) in more efficient way and lets say wew have more than two dice.
die <- function(nu