| 1 |
.\" Man file for rolldice(6) - v__VERSION__ - 16 Oct 2015 |
| 2 |
.\" (c) Stevie Strickland, 1999-2012 |
| 3 |
.\" |
| 4 |
.TH ROLLDICE 6 "16 Oct 2015" Linux |
| 5 |
.SH NAME |
| 6 |
rolldice \- rolls virtual dice |
| 7 |
.SH SYNOPSIS |
| 8 |
.B rolldice [ |
| 9 |
.I options |
| 10 |
.B ] |
| 11 |
.I [dice_string |
| 12 |
.I [dice_string |
| 13 |
.I ...]] |
| 14 |
.SH DESCRIPTION |
| 15 |
.B rolldice |
| 16 |
rolls virtual dice. The dice strings passed on the command line contain |
| 17 |
information on the dice to roll in a format comparable to the format used in |
| 18 |
most role playing games. |
| 19 |
.P |
| 20 |
If no dice strings are provided as command line arguments, |
| 21 |
.B rolldice |
| 22 |
uses stdin as input. |
| 23 |
.SH OPTIONS |
| 24 |
.RS |
| 25 |
.IP -h,--help |
| 26 |
returns the usage of diceroll |
| 27 |
.IP -v,--version |
| 28 |
returns the version of diceroll |
| 29 |
.IP -r,--random |
| 30 |
uses /dev/random for random number generating |
| 31 |
.IP -u,--urandom |
| 32 |
uses /dev/urandom for random number generating (default) |
| 33 |
.IP -s,--separate |
| 34 |
prints out the result of each individual die separately, as well as the |
| 35 |
operations and totals |
| 36 |
.IP -i,--interactive |
| 37 |
prompts the user to input dice strings. Differs from normal stdin input in |
| 38 |
that errors do not cause the program to immediately exit, but rather return |
| 39 |
to the prompt. |
| 40 |
.RE |
| 41 |
.SH "DICE STRING FORMAT" |
| 42 |
The dice string uses the following format: |
| 43 |
.RS |
| 44 |
.IP {#x}{#}d[#|%]{*#}{+/-#}{s#} |
| 45 |
.RE |
| 46 |
.P |
| 47 |
The dice string doesn't have to be in the exact format outlined above, |
| 48 |
but this is the order I use. It will try to parse any different |
| 49 |
string containing the same sections in the best way it can, and will |
| 50 |
throw out anything that isn't one of the sections below. |
| 51 |
.P Now, to break this format down section by section: |
| 52 |
.RS |
| 53 |
.IP {#}d[#|%] |
| 54 |
The first number is the |
| 55 |
number of dice to roll, and the second number is the number of sides the |
| 56 |
dice have. The numbers rolled on each die are then added up and given |
| 57 |
as the result. Hence 3d6 means "roll three six-sided dice, add them |
| 58 |
together and return the result". If the first number is left out, then |
| 59 |
the number of dice defaults to 1. If the second number is not a number, |
| 60 |
but a percentage sign (%), then the number of sides becomes 100 (for a |
| 61 |
percentage roll). If this is not included in the dice string, then the |
| 62 |
default is 1d6. |
| 63 |
.IP {#x} |
| 64 |
This number describes how many times to roll. For example, if you want to roll 3 |
| 65 |
6-sided dice 6 times, you use the dice string 6x3d6. This returns six numbers, |
| 66 |
corresponding to the six different rolls. |
| 67 |
.IP {*#} |
| 68 |
This number describes how many times to multiply the result of each roll. |
| 69 |
3d6*100 returns a number in the range of 300-1800, because 3-18 is the |
| 70 |
range for 3d6 and the result is then multipled by 100. |
| 71 |
.IP {+/-#} |
| 72 |
This number is the modifier to be added or subtracted, depending on the sign, |
| 73 |
from each roll. 1d4+1 results in a range from 2-5 (1-4 for the die, plus |
| 74 |
1). This step is handled *after* the multiplication modifier. |
| 75 |
.IP {s#} |
| 76 |
This number describes how many lowest dice rolls to drop. This step is |
| 77 |
handled *before* the multiplication modifier. |
| 78 |
.RE |
| 79 |
.P Any combination of the optional parts of the string may be used, but only |
| 80 |
in the order show above. For an extreme example, "3x4d6*5+1s2" would roll |
| 81 |
four six-sided dice, drop the lowest two, multiply the result by 5, add 1 to |
| 82 |
that, and repeat the process two more times, for a total of three results. |
| 83 |
.SH DIAGNOSTICS |
| 84 |
The following error messages may appear on STDERR: |
| 85 |
|
| 86 |
Requested * is too large |
| 87 |
.RS |
| 88 |
Memory could not be allocated while parsing the string passed to the |
| 89 |
.B rolldice |
| 90 |
program |
| 91 |
.RE |
| 92 |
Problems with the malformed dice string |
| 93 |
.RS |
| 94 |
The dice string contains a syntax error (see upper section DICE STRING FORMAT) |
| 95 |
.RE |
| 96 |
Unknown option |
| 97 |
.RS |
| 98 |
An unknown command-line option was provided |
| 99 |
.RE |
| 100 |
|
| 101 |
The exit values returned by |
| 102 |
.B rolldice |
| 103 |
follow the BSD convention. |
| 104 |
.SH AUTHOR |
| 105 |
Stevie Strickland <[email protected]> |
| 106 |
.SH VERSION |
| 107 |
__VERSION__ - 18 Dec 2012 |