Roll any dice from the command line.
| .gitignore | Initial commit | |
| README.md | Update README.md | |
| roll.py | Update roll.py | |
roll_dice
Roll any dice from the command line.
Usage
You can use the following formats:
d[SIDES],[DICE]d[SIDES],[DICE]d[SIDES]+/-[MODIFIER]. Add a trailingato roll with (dis)advantage.forf+/-[MODIFIER]to roll FATE dice.-ifor interactive mode. Just hit return to exit interactive mode.
Examples:
> python roll.py
Usage: python roll.py [X]dY[+-]Z[a] or f[+-]Z
> python roll.py d20
[15] + 0 => 15
> python roll.py d20a
[17] + 0 => 17
[3] + 0 => 3
> python roll.py 3d6+2
[6, 6, 3] + 2 => 17
> python roll.py 4d4-1
[2, 2, 1, 2] + -1 => 6
> python roll.py f
[ + + -] + 0 => 1
> python roll.py f+3
[ +] + 3 => 4
Use -i for interactive mode.
> python roll.py -i
Roll: 2d4
[2, 3] + 0 => 5
Roll: help
Please use XdY[+-]Z[a] or f[+-]Z format.
Roll:
>