RFYL - An RPG dice roller.

A dice roller accepting dice notation written in Rust. A spiritual successor to froll.

Supported input

Documentation

Static functions

roll(input: &str) -> Returns a DiceRolls object.

Struct DiceRolls

| Fields | Type | Description | |-----------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------| | rolls | Vec<DiceRoll> | Vector of DiceRoll. | | formula | Vec<String> | Vector of Strings that contains the parsed formula written in postfix (RPN). | | rolls_formula | Vec<String> | Vector of Strings that contains the parsed formula written in postfix (RPN) with the original dice notation instead of the rolled result. |

| Methods | Return Type | Description | |--------------------------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------| | get_result(&self) | i32 | Returns the solved result of the formula. | | get_sum_of_rolls(&self) | i32 | Returns a simple sum of the rolls. | | get_rolls_string(&self) | String | Returns a formatted String showing the dice and the rolled results. | | get_formula_string_as_rpn(&self) | String | Returns a postfix formatted String showing the formula. | | get_formula_string_as_infix(&self) | String | Returns an infix formatted String showing the formula. | | get_rolls_formula_string_as_rpn(&self) | String | Returns a postfix formatted String showing the formula withthe original dice notation instead of the rolled result. | | get_rolls_formula_string_as_infix(&self) | String | Returns a infix formatted String showing the formula withthe original dice notation instead of the rolled result. |

Struct DiceRoll

| Fields | Type | Description | |-----------------|---------|---------------------------------------| | sides | i32 | Number of sides the rolled dice had | | result | i32 | Result of the roll |

License

rfyl is Public Domain software available under the Creative Commons 0. See LICENSE and COPYING for more information.