fudge: Difference between revisions
Jump to navigation
Jump to search
Bubblobill (talk | contribs) m (revert) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=fudge | |name=fudge | ||
|description= | |description= | ||
Generates random numbers to emulate dice rolls; returns the total of a special Fudge dice roll. When these dice are rolled, the result is {{code|-1}}, {{code|0}}, or {{code|1}}, this function then sums up all of the dice rolled and returns that sum. | Generates random numbers to emulate dice rolls; returns the total of a special Fudge dice roll. When these dice are rolled, the result is {{code|-1}}, {{code|0}}, or {{code|1}}, this function then sums up all of the dice rolled and returns that sum. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
fudge(times) | fudge(times) | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
f(times) | f(times) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param|times|The number of times to roll the dice.}} | {{param|times|The number of times to roll the dice.}} | ||
|examples= | |examples= | ||
Roll ten special Fudge dice. | Roll ten special Fudge dice. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[t: fudge(10)] | [t: fudge(10)] | ||
</ | </syntaxhighlight> | ||
Returns a number that is between {{code|-10}} and {{code|10}}. | Returns a number that is between {{code|-10}} and {{code|10}}. | ||
Roll five special Fudge dice, using variables. | Roll five special Fudge dice, using variables. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: DiceTimes = 5] | [h: DiceTimes = 5] | ||
[t: fudge(DiceTimes)] | [t: fudge(DiceTimes)] | ||
</ | </syntaxhighlight> | ||
Returns a number than is between {{code|-5}} and {{code|5}}. | Returns a number than is between {{code|-5}} and {{code|5}}. | ||
|also= | |also= | ||
For another method of rolling dice, see [[Dice Expressions]]. | For another method of rolling dice, see [[Dice Expressions]]. | ||
}} | }} | ||
[[Category:Dice Function]] | [[Category:Dice Function]] |
Latest revision as of 23:59, 9 February 2023
fudge() Function
Generates random numbers to emulate dice rolls; returns the total of a special Fudge dice roll. When these dice are rolled, the result is
-1
, 0
, or 1
, this function then sums up all of the dice rolled and returns that sum.Usage
fudge(times)
f(times)
Parameters
times
- The number of times to roll the dice.
Examples
Roll ten special Fudge dice.
Returns a number than is between
[t: fudge(10)]
Returns a number that is between-10
and10
. Roll five special Fudge dice, using variables.
[h: DiceTimes = 5]
[t: fudge(DiceTimes)]
-5
and 5
.See Also
For another method of rolling dice, see Dice Expressions.