Skip to content

A library for evaluating dice notation for Pathfinder RPG

License

Notifications You must be signed in to change notification settings

orsinium-labs/pathfinder_dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)