View Source ExRPG.Dice (ExRPG v0.1.0)

This module deals with the rolling of any and all dice

Link to this section Summary

Functions

Rolls a die with the number of sides given in the input

Rolls the a number of multisided dice

Validates that a given string conforms to the expexted dice specifying format

Link to this section Functions

Rolls a die with the number of sides given in the input

Returns: the rolled number

examples

Examples

iex> ExRPG.Dice.roll(4)
3
Link to this function

roll(number_of_dice, dice_sides)

View Source

Rolls the a number of multisided dice

Returns: List of die roll results

examples

Examples

iex> ExRPG.Dice.roll(3, 4)
[1, 4, 2]

Validates that a given string conforms to the expexted dice specifying format

Returns: the input string

examples

Examples

iex> ExRPG.Dice.validate_dice_str("3d4")
"3d4"