ROLLDICE(6) | Games Manual | ROLLDICE(6) |

- -h,--help
- returns the usage of diceroll

- -v,--version
- returns the version of diceroll

- -r,--random
- uses /dev/random for random number generating

- -u,--urandom
- uses /dev/urandom for random number generating (default)

- -s,--separate
- prints out the result of each individual die separately, as well as the operations and totals

- -i,--interactive
- prompts the user to input dice strings. Differs from normal stdin input in that errors do not cause the program to immediately exit, but rather return to the prompt.

- {#x}{#}d[#|%]{*#}{+/-#}{s#}

- {#}d[#|%]
- The first number is the number of dice to roll, and the second number is the number of sides the dice have. The numbers rolled on each die are then added up and given as the result. Hence 3d6 means "roll three six-sided dice, add them together and return the result". If the first number is left out, then the number of dice defaults to 1. If the second number is not a number, but a percentage sign (%), then the number of sides becomes 100 (for a percentage roll). If this is not included in the dice string, then the default is 1d6.

- {#x}
- This number describes how many times to roll. For example, if you want to roll 3 6-sided dice 6 times, you use the dice string 6x3d6. This returns six numbers, corresponding to the six different rolls.

- {*#}
- This number describes how many times to multiply the result of each roll. 3d6*100 returns a number in the range of 300-1800, because 3-18 is the range for 3d6 and the result is then multipled by 100.

- {+/-#}
- This number is the modifier to be added or subtracted, depending on the sign, from each roll. 1d4+1 results in a range from 2-5 (1-4 for the die, plus 1). This step is handled *after* the multiplication modifier.

- {s#}
- This number describes how many lowest dice rolls to drop. This step is handled *before* the multiplication modifier.

Memory could not be allocated while parsing
the string passed to the **rolldice** program

Problems with the malformed dice string
The dice string contains a syntax error (see
upper section DICE STRING FORMAT)

Unknown option
An unknown command-line option was
provided

16 Oct 2015 | Linux |