Safe Haskell | None |
---|---|
Language | Haskell2010 |
Representation of dice for parameters scaled with current level depth.
- data Dice
- diceConst :: Dice -> SimpleDice
- diceLevel :: Dice -> SimpleDice
- diceScale :: Dice -> Int
- (|*|) :: Dice -> Int -> Dice
- d :: Int -> Dice
- ds :: Int -> Dice
- dl :: Int -> Dice
- intToDice :: Int -> Dice
- maxDice :: Dice -> Int
- minDice :: Dice -> Int
- meanDice :: Dice -> Rational
- reduceDice :: Dice -> Maybe Int
- data DiceXY = DiceXY !Dice !Dice
- maxDiceXY :: DiceXY -> (Int, Int)
- minDiceXY :: DiceXY -> (Int, Int)
- meanDiceXY :: DiceXY -> (Rational, Rational)
- type SimpleDice = Frequency Int
Frequency distribution for casting dice scaled with level depth
Dice for parameters scaled with current level depth.
To the result of rolling the first set of dice we add the second,
scaled in proportion to current depth divided by maximal dungeon depth.
The result if then multiplied by the scale --- to be used to ensure
that dice results are multiples of, e.g., 10. The scale is set with |*|
.
diceConst :: Dice -> SimpleDice Source
diceLevel :: Dice -> SimpleDice Source
Maximal value of dice. The scaled part taken assuming maximum level. Assumes the frequencies are not null.
Minimal value of dice. The scaled part ignored. Assumes the frequencies are not null.
meanDice :: Dice -> Rational Source
Mean value of dice. The scaled part taken assuming average level. Assumes the frequencies are not null.
reduceDice :: Dice -> Maybe Int Source
Dice for rolling a pair of integer parameters representing coordinates.
Dice for rolling a pair of integer parameters pertaining to, respectively, the X and Y cartesian 2D coordinates.
meanDiceXY :: DiceXY -> (Rational, Rational) Source
Mean value of DiceXY.
type SimpleDice = Frequency Int Source