No Description

olinox f39d4523e2 v1.1.4 8 years ago
dist f39d4523e2 v1.1.4 8 years ago
docs 72e6508ad2 Add dice 'explosion' (adxX or adx!) 8 years ago
xdice.egg-info f39d4523e2 v1.1.4 8 years ago
.gitignore 1d34b28551 Integrate the 'd', 'Ad', and 'dX' short notations 8 years ago
.travis.yml 57695ab03a Configure travis CI 8 years ago
LICENSE.txt cc23029a8b Add license 8 years ago
README.rst 9168b6e234 Reformat readme to rst 8 years ago
nose2.cfg 1af1b03105 Rename to 'xdice' 8 years ago
roll.py 72e6508ad2 Add dice 'explosion' (adxX or adx!) 8 years ago
setup.py 72e6508ad2 Add dice 'explosion' (adxX or adx!) 8 years ago
test.py 72e6508ad2 Add dice 'explosion' (adxX or adx!) 8 years ago
xdice.py 72e6508ad2 Add dice 'explosion' (adxX or adx!) 8 years ago

README.rst

|Build Status| |Coverage Status| |Documentation Status|

**xdice**

*xdice* is a lightweight python library for managing dice, scores, and
dice-notation patterns.

- Parse almost any Dice Notation pattern: '1d6+1', 'd20', '3d%', '1d20//2 - 2*(6d6+2)', 'max(1d4+1,1d6)', '3D6L2', 'R3(1d6+1)'...etc.
- API help you to easily manipulate dices, patterns, and scores as objects
- A command line tool for convenience


Python Versions
^^^^^^^^^^^^^^^

DiceRollParser has been tested with **python 3.3+**

Documentation
~~~~~~~~~~~~~

For more, see the Documentation_

Examples:
^^^^^^^^^

::

import dice

# Roll simple dices with **rolldice()**

score = rolldice(6, amount=2)

# manipulates score as an integer

print(score)
>> 11
print(score * 2)
>> 22
print(score == 11)
>> True

# Or iterates over the results

for result in score:
print(result)
>> 5
>> 6

# Parse patterns with **roll()**

ps = roll("2d6+18")

print(ps)
>> 28
print(ps.format())
>> '[5,6]+18'

ps = roll("6D%L2")

print(ps)
>> 315
print(ps.format(verbose=True))
>> '6D%L2(scores:[80, 70, 76, 89], dropped:[2, 49])'


CLI
^^^

Run ``python roll.py [options] ``

::

Usage:
roll [options]

Options:
-s Numeric score only

-h --help Displays help message
--version Displays current xdice version

CONTRIBUTION
^^^^^^^^^^^^

Any opinion / contribution is welcome, please contact us.

TO INSTALL
^^^^^^^^^^

::

pip install xdice

License
^^^^^^^

*xdice* is under GNU License

Author
^^^^^^

Olivier Massot, 2017, with *Cro-ki Lab*

Tags
^^^^

::

dice roll d20 game random parser dices role board

.. _Documentation: https://xdice.readthedocs.io/en/latest/

.. |Build Status| image:: https://travis-ci.org/cro-ki/xdice.svg?branch=master
:target: https://travis-ci.org/cro-ki/xdice
.. |Coverage Status| image:: https://coveralls.io/repos/github/cro-ki/xdice/badge.svg?branch=master
:target: https://coveralls.io/github/cro-ki/xdice?branch=master
.. |Documentation Status| image:: https://readthedocs.org/projects/xdice/badge/?version=latest
:target: http://xdice.readthedocs.io/en/latest/?badge=latest