(decide-boolean-attribute attr)
This function structures the data for boolean attributes.
This function structures the data for boolean attributes.
(decide-dice-attribute attr)
This function dispatches dice attributes to be calculated.
This function dispatches dice attributes to be calculated.
(decide-dice-option option)
This function totals up the additive dice rolls and the subtractive dice rolls, then subtracts the latter from the former.
This function totals up the additive dice rolls and the subtractive dice rolls, then subtracts the latter from the former.
(decide-distinct-attribute attr)
This function structures the data for distinct attributes.
This function structures the data for distinct attributes.
(decide-fixed-attribute attr)
Structures the data for fixed attributes.
(decide-fixed-attribute {:id :name :type :fixed :value "Tom"}) => {:name "Tom"}
Structures the data for fixed attributes. (decide-fixed-attribute {:id :name :type :fixed :value "Tom"}) => {:name "Tom"}
(decide-fn-attribute attr spec)
Structures the data for function attributes.
Structures the data for function attributes.
(decide-multiple-choice-attribute attr)
This function structures the data for multiple choice attributes.
This function structures the data for multiple choice attributes.
(decide-n-choice-attribute attr)
This function structures the data for n-choice attributes.
This function structures the data for n-choice attributes.
(decide-random-attribute attr)
This function dispatches random attributes to be calculated.
This function dispatches random attributes to be calculated.
(get-weighted-distribution opts)
Takes any number of options with probabilities expressed as numerators and returns a weighted distribution suitable for use with rand-nth.
(get-weighted-distribution [[:male 1] [:female 4]]) => [:male :female :female :female :female]
Takes any number of options with probabilities expressed as numerators and returns a weighted distribution suitable for use with rand-nth. (get-weighted-distribution [[:male 1] [:female 4]]) => [:male :female :female :female :female]
(roll-boolean prob)
This function takes a probability, specified as a number between 0.0 and 1.0, and returns a decision for that probability.
This function takes a probability, specified as a number between 0.0 and 1.0, and returns a decision for that probability.
(roll-dice dice)
Simple dice roller function, takes a single input in the form {:number n :sides z} and rolls ndz (dice notation) dice, returning only the cumulative total.
Simple dice roller function, takes a single input in the form {:number n :sides z} and rolls ndz (dice notation) dice, returning only the cumulative total.
(roll-dice-for-function dice fn)
This sums the rolls for all dice with a specified function.
This sums the rolls for all dice with a specified function.
(roll-distinct & opts)
Compositional function which takes options for a distinct attribute and randomly chooses one from a weighted distribution.
Compositional function which takes options for a distinct attribute and randomly chooses one from a weighted distribution.
(roll-once sides)
Simulates a single roll of a dice.
Simulates a single roll of a dice.
(sides dice)
Takes a dice and returns its number of sides, if the number of sides is absent from the dice, we return 1.
Takes a dice and returns its number of sides, if the number of sides is absent from the dice, we return 1.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close