diceroll is a simple command line dice roller.
It can be invoked through the
roll command once installed.
Requires the pyparsing library.
The basic components of
diceroll expressions are dice and integers, which can then have operators applied to them. The expression is always read left-to-right, so operators are called in order of position, not order of precedence.
Multiple expressions can be given, seperated by commas (
Dice are expressed in the form
N is the number of dice that will be rolled, and
S is the number of sides those dice have.
Integers are simply expressed as one or more digits (i.e.
Subexpressions can be placed in parenthesis
(), and are evaluated in full before the main expression is evaluated.
These operators act on the previous component, and almost always accept only dice.
<D> total: Returns the sum total of the diceroll (as an integer value).
<D>sort: Sorts diceroll
<D>explode: Rolls an extra die for every diceroll that hits the maximum.
These operators act on two components (the previous and the next).
Performs a basic operation on two components - respectively multiplication, division, addition, subtraction. Dicerolls are converted to integers, using the sum total of the rolls.
Drop and Keep
<X>drop<Y>: Drop the
Y lowest rolls from diceroll
<X>keep<Y>: Similar to drop, keeps the
Y highest rolls from
Reroll and Recursive Reroll
<D>reroll<N>: Reroll any dice in
D that are equal to or lower than
<D>rreroll<N>: The same as
reroll, but does so recursively - any rerolled dice equal to or lower than
N are also rerolled
<X>diff<Y>: Returns the difference between
<D> success [C][B] <N> Returns the count of dice in
D that land equal to or higher than
B are optional flags:
C removes a success every time a die hits the minimum,
B adds a success every time a die lands on the maximum.