diced
Types
pub type Dice {
Dice(amount: Int, value: Int, variant: RollVariant)
}
Constructors
-
Dice(amount: Int, value: Int, variant: RollVariant)
pub type DiceError {
InvalidAmount
InvalidString
InvalidValue
}
Constructors
-
InvalidAmount -
InvalidString -
InvalidValue
pub type RollVariant {
Advantage
Disadvantage
Normal
}
Constructors
-
Advantage -
Disadvantage -
Normal
Functions
pub fn dice_from_string(
string string: String,
) -> Result(Dice, DiceError)