Difference between revisions of "Dice/Roller/Roll (String, RollerConfig)"
From DiceRoller Documentation
(Created page with "Rolls dice according to the given dice expression. Please see Dice Reference for more information about dice expressions. __NOTOC__ == Syntax == <syntaxhighlight lang="C#"...") |
|||
Line 1: | Line 1: | ||
Rolls dice according to the given dice expression. Please see [[Dice Reference]] for more information about dice expressions. | Rolls dice according to the given dice expression. Please see [[Dice Reference]] for more information about dice expressions. | ||
− | + | {{APIdoc|Roller.Roll Method}} | |
+ | |||
== Syntax == | == Syntax == | ||
<syntaxhighlight lang="C#"> | <syntaxhighlight lang="C#"> |
Revision as of 03:43, 8 April 2017
Rolls dice according to the given dice expression. Please see Dice Reference for more information about dice expressions.
Syntax
public static RollResult Roll(
string diceExpr
)
Parameters
- diceExpr
- Type: System.String
- A dice expression.
Return value
Type: Dice.RollResult
The result of rolling diceExpr.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | diceExpr is null .
|
DiceException | An error was detected with diceExpr. |
When a DiceException is thrown, the exception will contain an ErrorCode property which describes the error in more detail.
Example
RollResult result = Roller.Roll("1d20+4");
Console.WriteLine(result.Value);