high_roller v1.0.0 HighRoller.Parser
Documentation for the Parser module. This module contains all the code for parsing strings and turning them into the results of dice rolls.
Link to this section Summary
Functions
Parses a roll string into a final result
Parses a roll string and returns both the final result and the results of each of the rolls
Link to this section Functions
Link to this function
parse(roll_string)
Parses a roll string into a final result
Examples
iex> HighRoller.Parser.parse("3d1")
3
Link to this function
parse_with_results(roll_string)
Parses a roll string and returns both the final result and the results of each of the rolls
Examples
iex> HighRoller.Parser.parse("3d1+1")
{total: 4, full_results: [[1, 1, 1], "+", 1]}