No project description provided
Project description
Dicey
======= version 2.0.7
A python package for evaluating dice rolls.
Description
Dicey parses strings of dice rolls of the form:
'1d20 + 2 + 2d4 - 1d8 + 1 - min {3}'
Where min (or max) holds the value of the highest or lowest single die rolled and {3} is how many times to repeat the expression. [min|max] and {num} are optional.
Dicey then rolls the specified dice, and computes the total. Valid arithmentic operators are + - * / (). Dicey will always translate individual die expressions to a randomized result
before applying arithmetic operators.
Installation
pip install dicey
Usage
Command Line
Usage:
dicey
dicey <expression>
Options:
-h --help show this screen.
As a python package
from dicey.dieparser import DieParser
d = DieParser()
d.parse('1d20 + 1d4 + 2')
result = d.__str__()
print(result)
# or of course simply:
print(d)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dicey-2.0.7.tar.gz.
File metadata
- Download URL: dicey-2.0.7.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccbc89b7e3f7173289528759af872785332062cb0eedd9edd4daeb849628188c
|
|
| MD5 |
fb7a0304c17ee27b6fadd562947cd719
|
|
| BLAKE2b-256 |
4bf4daadf6a7dc087d45a3d0bbf96aca8dd191398f7809dcc0ab36b042c3a285
|
File details
Details for the file dicey-2.0.7-py3-none-any.whl.
File metadata
- Download URL: dicey-2.0.7-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70b8f705eba737fe5c4c675f9a6aedc8c31ab28937aab1941e4e2bc80fd292b6
|
|
| MD5 |
cd8fbffd16deb486f04dab9a882a0b66
|
|
| BLAKE2b-256 |
944eb62660b537729cd60559da980fe6666d43e162678060e66bce87b650d445
|