~japanoise/roll

dice roller
69455dfa — japanoise 2 years ago
Initial

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~japanoise/roll
read/write
git@git.sr.ht:~japanoise/roll

You can also use your local clone with git send-email.

#roll - dice roller

Rolls dice in the usual notation. Thanks to score for helping me write the dice library.

#usage

Install as you would any other small C program, i.e. make && cp roll /usr/local/bin.

Args passed to the program will be parsed and rolled:

$ roll 3d6
rolling 3d6: 6, 6, 5, 
total: 17

$ roll 4dF
rolling 4dF: 1, -1, -1, -1, 
total: -2

$ roll +2d20
rolling +2d20: 19, 13, 
total: 19

$ roll -2d20
rolling -2d20: 10, 12, 
total: 10

#caveats

  • it doesn't understand standard plus notation e.g. 1d6+1. You'll have to add after you roll.
  • it doesn't do d%, d66, etc. Use e.g. 2d10, 2d6, 1d100…
  • garbage in, garbage out. if you pass it an invalid dice string it may fail spectacularly or barf all over your terminal, though hopefully it will just quit out before actually rolling.

#copying

Licensed MIT.