Difference between revisions of "User:Paxed/Template:dicemin"

From NetHackWiki
Jump to navigation Jump to search
m (testing)
 
m
Line 1: Line 1:
<onlyinclude><includeonly>{{#expr:{{{1}}}+{{{3|0}}}}}</includeonly></onlyinclude>
+
<onlyinclude><includeonly>
  
This template returns the minimum value a die roll in the standard [[d notation|d-notation]] can give. This cannot handle more than one d-notation, so no <tt>1d6+1d4</tt>.
+
{{#expr:{{#explode:{{{1}}}|d|0}}
  
Usage: <tt><nowiki>{{dicemin|A|B|C}}</nowiki></tt>
+
{{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#pos:{{#explode:{{{1}}}|d|1}}|+}} }}
 +
| + {{#sub: {{#explode:{{{1}}}|d|1}}|{{#pos:{{#explode:{{{1}}}|d|1}}|+}} }}
 +
|{{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#pos:{{#explode:{{{1}}}|d|1}}|-}} }}
 +
  | - {{#sub: {{#explode:{{{1}}}|d|1}}|{{#pos:{{#explode:{{{1}}}|d|1}}|-}} }}
 +
  | +0
 +
}}
 +
}}
 +
 
 +
}}
 +
</includeonly></onlyinclude>
 +
 
 +
This template returns the minimum value a die roll in the standard [[d notation|d-notation]] can give. This cannot handle more than one d-notation, so no <tt>1d6+1d4</tt>. See also [[User:Paxed/Template:dicemax]].
 +
 
 +
Usage: <tt><nowiki>{{dicemin|AdB+C}}</nowiki></tt>
  
 
Where:
 
Where:
 
*A is the number of dice to be rolled.
 
*A is the number of dice to be rolled.
 
*B is the number of sides the dices have.
 
*B is the number of sides the dices have.
*C is an (optional) modifier added after the diceroll.
+
*C is an (optional) modifier added after the diceroll. Use only simple plusses or minuses here!
  
 
Output:
 
Output:
Line 14: Line 27:
 
*<tt><nowiki>{{dicemin|2|10|5}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|2|10|5}}</tt>
 
*<tt><nowiki>{{dicemin|2|10|5}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|2|10|5}}</tt>
 
*<tt><nowiki>{{dicemin|3|8|-2}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|3|8|-2}}</tt>
 
*<tt><nowiki>{{dicemin|3|8|-2}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|3|8|-2}}</tt>
 +
 +
---
 +
 +
 +
{{#expr:{{{1}}}+{{{3|0}}}}}

Revision as of 16:32, 4 March 2008


This template returns the minimum value a die roll in the standard d-notation can give. This cannot handle more than one d-notation, so no 1d6+1d4. See also User:Paxed/Template:dicemax.

Usage: {{dicemin|AdB+C}}

Where:

  • A is the number of dice to be rolled.
  • B is the number of sides the dices have.
  • C is an (optional) modifier added after the diceroll. Use only simple plusses or minuses here!

Output:

  • {{dicemin|1|6}} gives

1

  • {{dicemin|2|10|5}} gives

2

  • {{dicemin|3|8|-2}} gives

3

---


Expression error: Unrecognized punctuation character "{".