fudge: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Initial write-up.)
 
m (Conversion script moved page Fudge to fudge: Converting page titles to lowercase)
 
(10 intermediate revisions by 4 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=
<source lang="mtmacro" line>
    <syntaxhighlight lang="mtmacro" line>
fudge(times)
    fudge(times)
</source>
    </syntaxhighlight>
'''Parameters'''
    <syntaxhighlight lang="mtmacro" line>
{{param|times|The number of times to roll the dice.}}
    f(times)
 
    </syntaxhighlight>
|examples=
    '''Parameters'''
Roll ten special Fudge dice.
    {{param|times|The number of times to roll the dice.}}
<source lang="mtmacro" line>
   
[t: fudge(10)]
    |examples=
</source>
    Roll ten special Fudge dice.
Returns a number that is between {{code|-10}} and {{code|10}}.
    <syntaxhighlight lang="mtmacro" line>
 
    [t: fudge(10)]
Roll five special Fudge dice, using variables.
    </syntaxhighlight>
<source lang="mtmacro" line>
    Returns a number that is between {{code|-10}} and {{code|10}}.
[h: DiceTimes = 5]
   
[t: fudge(DiceTimes, DiceSides)]
    Roll five special Fudge dice, using variables.
</source>
    <syntaxhighlight lang="mtmacro" line>
Returns a number than is between {{code|-5}} and {{code|5}}.
    [h: DiceTimes = 5]
 
    [t: fudge(DiceTimes)]
|also=
    </syntaxhighlight>
For another method of rolling dice, see [[Dice Expressions]].
    Returns a number than is between {{code|-5}} and {{code|5}}.
 
   
}}
    |also=
[[Category:Dice Function]]
    For another method of rolling dice, see [[Dice Expressions]].
   
    }}
    [[Category:Dice Function]]

Latest revision as of 23:17, 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.
    [t: fudge(10)]
   Returns a number that is between -10 and 10.
   
   Roll five special Fudge dice, using variables.
    [h: DiceTimes = 5]
    [t: fudge(DiceTimes)]
Returns a number than is between -5 and 5.

See Also

For another method of rolling dice, see Dice Expressions.