A library for evaluating dice notation for Pathfinder RPG
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pathfinder_dice
.gitignore
LICENSE
MANIFEST.in
README.md
tests.py

README.md

A library for evaluating dice notation for Pathfinder RPG.

Usage

Just roll!

>>> from pathfinder_dice import roll
>>> roll("max(2, 4) + 2d6x2x4")
54

Result of multiplying in Pathfinder have some specific:

>>> roll('1x2x3')
4

For right multiplying you can use *:

>>> roll('1*2*3')
6

You can use digits, min and max functions, all functions from math module, braces, arithmetic operators. Otherwise ArithmeticError will be raised.

>>> roll('print(2)')
ArithmeticError: Invalid expression: print(2)