dice — dice roller
and coin flipper
The dice utility displays pseudorandom
results of specified dice roll or coinflip expressions. It accepts the
following flags:
-C
- Flip a coin, displaying “heads” or “tails”. If
-q is specified, display “0” or
“1” instead.
-S
- Parse a line read from standard input instead of
expr.
-q
- Be quieter.
If -c is not specified, an expression in
the form
xdy[+xdy]...
is parsed and randomly evaluated. Unless -q is
specified, the expression is printed before the result, followed by an
equals sign.
The dice utility exits 0 on
success, and >0 if an error occurs.