Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Template:Dice expression/doc"

From Roll20 Wiki

Jump to: navigation, search
(new)
 
Line 1: Line 1:
Formalizes the [[Dice Reference#Roll20 Dice Specification|dice expression]] syntax. An anonymous parameter may be given to change the name of the formal syntax token which begins the sequence.
+
Formalizes the [[Dice Reference#Roll20 Dice Specification|dice expression]] syntax. Each of the <code>token</code> in the output below may be changed by offering it up as a parameter. For example, each instance of <code>compare</code> can be changed by supplying a value for the parameter ''compare''. This allows callers of this template to avoid name collisions with other tokens in the formal syntax.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 8: Line 8:
 
|| <code><nowiki>{{dice expression}}</nowiki></code>
 
|| <code><nowiki>{{dice expression}}</nowiki></code>
 
|| {{dice expression}}
 
|| {{dice expression}}
 +
|- style="vertical-align:top"
 +
|| <pre>{{dice expression
 +
|dice expression=foo
 +
|roll=bar
 +
|modifier=baz
 +
|expression list=fizz
 +
|group modifier=buzz}}</pre>
 +
|| {{dice expression
 +
|dice expression=foo
 +
|roll=bar
 +
|modifier=baz
 +
|expression list=fizz
 +
|group modifier=buzz}}
 
|}
 
|}
 
<includeonly>[[Category:Regular Grammar Templates]]</includeonly><noinclude>[[Category:Template Documentation]]</noinclude>
 
<includeonly>[[Category:Regular Grammar Templates]]</includeonly><noinclude>[[Category:Template Documentation]]</noinclude>

Revision as of 17:57, 14 January 2015

Formalizes the dice expression syntax. Each of the token in the output below may be changed by offering it up as a parameter. For example, each instance of compare can be changed by supplying a value for the parameter compare. This allows callers of this template to avoid name collisions with other tokens in the formal syntax.

Wikitext Output
{{dice expression}} dice expressionroll

dice expressiondice expressionmodifier
dice expression → {expression list}group modifier
dice expressiondice expression operator dice expression
dice expressionfunction(dice expression)
rollmath expressiondf
rollmath expressiondmath expression
math expressioninteger
math expression → (math expression operator math expression)
operator → +
operator → -
operator → *
operator → /
function → floor
function → ceil
function → round
function → abs
modifiercompare
modifier → fcompare
modifier → !compare
modifier → !!compare
modifier → !pcompare
modifier → rcompare
modifier → rocompare
modifierkeep-drop
modifier → s
modifier → sd
compare → ε
compareinteger
compare → >integer
compare → <integer
keep-dropkeep
keep-dropkeepinteger
keep-dropdrop
keep-dropdropinteger
keep → k
keep → kh
keep → kl
drop → d
drop → dh
drop → dl
expression listdice expression, rest expression list
rest expression listdice expression
rest expression listexpression list
group modifierkeep-drop
group modifiercompare
group modifier → fcompare

{{dice expression
|dice expression=foo
|roll=bar
|modifier=baz
|expression list=fizz
|group modifier=buzz}}
foobar

foofoobaz
foo → {fizz}buzz
foofoo operator foo
foofunction(foo)
barmath expressiondf
barmath expressiondmath expression
math expressioninteger
math expression → (math expression operator math expression)
operator → +
operator → -
operator → *
operator → /
function → floor
function → ceil
function → round
function → abs
bazcompare
baz → fcompare
baz → !compare
baz → !!compare
baz → !pcompare
baz → rcompare
baz → rocompare
bazkeep-drop
baz → s
baz → sd
compare → ε
compareinteger
compare → >integer
compare → <integer
keep-dropkeep
keep-dropkeepinteger
keep-dropdrop
keep-dropdropinteger
keep → k
keep → kh
keep → kl
drop → d
drop → dh
drop → dl
fizzfoo, rest expression list
rest expression listfoo
rest expression listfizz
buzzkeep-drop
buzzcompare
buzz → fcompare