Top Level Namespace
Defined Under Namespace
Modules: FifthedSim Classes: Fixnum, String
Instance Method Summary collapse
-
#combination(n, r) ⇒ Object
Mathemetical combination.
-
#DiceExpression(arg) ⇒ Object
C-style conversion, yay.
Instance Method Details
#combination(n, r) ⇒ Object
Mathemetical combination
22 23 24 |
# File 'lib/fifthed_sim/nodes/multi_node.rb', line 22 def combination(n, r) n.factorial / (r.factorial * (n - r).factorial) end |
#DiceExpression(arg) ⇒ Object
C-style conversion, yay
119 120 121 122 |
# File 'lib/fifthed_sim/dice_expression.rb', line 119 def DiceExpression(arg) return arg.to_dice_expression if arg.respond_to? :to_dice_expression throw ArgumentError, "Cannot convert #{arg.class} to DiceExpression" end |