Roll: A Language for Specifying Die-Rolls

  • Authors:
  • Torben Æ. Mogensen

  • Affiliations:
  • -

  • Venue:
  • PADL '03 Proceedings of the 5th International Symposium on Practical Aspects of Declarative Languages
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Role-playing games (RPG's) use a variety of methods for rolling dice to add randomness to the game. In the simplest form, a small number of identical dice are rolled and added, but more advanced forms involve cumulative rerolling of 6's, doubling the value of doubles, removing the lowest or highest result or counting the number of dice that are below a threshold, and many other weird and wonderful modifications.While die-roll programs and net-based die-roll servers exist, they can usually only handle the simplest form of die-rolls. This paper describes Roll, a simple functional language for defining how dice are rolled. Such definitions are then used to emulate die-rolls or make probability calculations.We describe two different semantics for Roll: One that corresponds to randomly rolling the dice and one for calculating the probability distribution. We discuss implementation issues regarding the latter.