View Source Rollex.Distribution (Rollex v0.9.0)
This module provides functions to calculate various outcome distributions of sets of dice. This includes minimums, maximums, and histograms.
Link to this section Summary
Functions
Calculates the maximum value possible from a roll definition
Calculates the minimum value possible from a roll definition
Calculates the minimum and maximum value possible from a roll definition
Takes histogram, a translation magnitude, and a 3-arity functions to apply to entries in the histogram, returning a translated histogram. Useful for performing arithmetic on histograms allowing for the representation of things such as "1d8+2"
Takes two histograms and combines them into one
Link to this section Functions
@spec histogram( quantity :: pos_integer(), sides :: pos_integer(), effort_count :: non_neg_integer() ) :: {map(), effort_count :: non_neg_integer()}
Calculates the maximum value possible from a roll definition
Calculates the minimum value possible from a roll definition
Calculates the minimum and maximum value possible from a roll definition
@spec translate_histogram( h :: map(), magnitude :: number(), Rollex.Utilities.merge_operation() ) :: map()
Takes histogram, a translation magnitude, and a 3-arity functions to apply to entries in the histogram, returning a translated histogram. Useful for performing arithmetic on histograms allowing for the representation of things such as "1d8+2"
Takes two histograms and combines them into one