A very complicated way to roll dice.