Skip to content
H. Dale McBane edited this page Aug 9, 2016 · 7 revisions

Welcome to the Die Roller wiki!

Die Roller is a tool that I created to simplify tracking die rolls while playing Pathfinder® and Dungeons & Dragons® with my kids. If you're like me, you role so many dice during a game that you can quickly lose track of what roll applied to what check; especially when your game master for larger groups. I overcome the confusion by opening a command shell on my laptop and running Die Roller from there. A typical session looks like the following...

> dieroller # klahr initiative
1D20
Result: => 20
> dieroller # thuanir initiative
1D20
Result: => 8
> dieroller # klahr attack
1D20
Result: => 1
> dieroller # thuanir attack
1D20
Result: => 16
> dieroller 1 8 + 2 # thuanir axe
1D8+2
Result: => 9

...you get the idea. I use comments following the command to track what the roll was used for and the command history in the shell contains all die rolls going backward chronologically. The comments with the commands also makes it easy to repeat rolls by searching through the history.

Die Roller uses four parameters to control how it simulates rolling dice..

  • dice - The number of dice to roll. For example, to roll two 20 sided dice (2D20), you could enter any of the following: dieroller 2, dieroller 2 20, dieroller --dice 2, etc. (Defaults to 1.)

  • sides - The number of sides per die. To role an 8 sided die (1d8), you could enter any of the following: dieroller 1 8, dieroller --sides 8, dieroller --sides 8 --dice 1, etc. (Defaults to 20.)

  • modifier - A modifier to applied after the dice are rolled. A modifier consists of an operator followed by a value. Die Roller understands three operators: +, -, and * which add the value to the roll, subtract the value to the roll, and multiply the roll by the value respectively. For example, to roll two four sided dice plus 2 (2D4+2) you could enter one of the following: dieroller 2 4 +2 or dieroller --modifier +2 --dice 2 --sides 4. (Defaults to no modifier.)

  • keep - The number of dice to keep from those rolled. A common way to generate ability scores in role playing games is to roll a number of dice and keep the highest ones; for example, roll four six sided dice (4D6) and keep the highest 3. To generate this roll with Die Roller, you could enter one of the following: dieroller 4 6 +0 3 or dieroller --dice 4 --sides 6 --keep 3. Note that if you use positional notation, you have to specify a modifier that does nothing (+0, -0, *1). (Defaults to all.)

As you've probably already figured out from the examples above, you can specify the parameters by position or by name, but not both. When you use named parameters, the order you use does not matter as long as the value follows the name. Here are some more examples.

dieroller 5
dieroller 1 10
dieroller 3 6 +3
dieroller 3 6 +6 2
dieroller --dice 5 --sides 100 --modifier +4 --keep 3
dieroller --dice 4 --sides 6 --keep 3

Preparing to Use Die Roller

All of the examples above assume that you have built a binary version of Die Roller and that it is in your executable path. To ceate a binary version of Die Roller, see Building Die Roller.

You can run Die Roller without building the binary executable by running the racket command followed by the script name and parameters. For example, racket dieroller.rkt --dice 4 --sides 4 --modifier +4.

Clone this wiki locally