WeightedRandom.Die (weighted_random v1.0.0-alpha.0)

Copy Markdown View Source

Represents a single Die, with a certain number of sides, weights, and current result.

Summary

Types

t()

@type t() :: %WeightedRandom.Die{
  preprocessed: struct(),
  result: any(),
  sides: integer(),
  weights: list()
}

Functions

add_weight(die, weights)

new(body, opts \\ [])

roll(die)