-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
14,995 additions
and
25 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 7bbf894653e3da1328d24cac321745e4 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
**xdice** | ||
|
||
*xdice* is a lightweight python library for managing dice, scores, and dice-notation patterns. | ||
|
||
It allows to easily interpret literal expressions as rolls of dice ('1d6', '3d4+3', '12d6+1d4'...etc.), then manipulate the results. | ||
|
||
#### Python Versions | ||
|
||
DiceRollParser has been tested with python 3.3+ | ||
|
||
#### Examples: | ||
|
||
import dice | ||
|
||
## Roll simple dices with **rolldice()** | ||
|
||
score = rolldice(6, amount=2) | ||
|
||
# manipulates score as an integer | ||
|
||
print( score, score * 2, score == 11 ) | ||
>> 11 22 True | ||
|
||
|
||
# Iterates over the results | ||
|
||
for result in score: | ||
print(result) | ||
>> 5 | ||
>> 6 | ||
|
||
# Parse patterns with **roll()** | ||
|
||
ps = roll("2d6+18") | ||
|
||
print( ps, ps.format() ) | ||
>> 28 '[5,6]+18' | ||
|
||
|
||
#### CLI | ||
|
||
Run `python roll.py [options] <expr>` | ||
|
||
Usage: | ||
roll [options] <expr> | ||
|
||
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 | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.