Skip to main content

A library for parsing and evaluating dice notation

Project description

A library for parsing and evaluating dice notation.

Todo

  • Unary and binary operators

  • Console and module API functions

Notes

Some rough notes on how I want the API to look:

>>> d = Dice('2d6')
Dice("Two six-sided dice")
>>> d.roll()
Roll(5, 5, sides=6)
>>> b = Bag('two six-sided dice', 'six-sided die', '4d2', (3,3), Dice('d1'))
>>> repr(b)
Bag((3,6), (4,2), (3,3))
>>> str(b)
"3d6, 4d2, 1d1"

Licence

The MIT License (MIT)

Copyright (c) 2013 Sam Clements

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dice-0.3.2.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file dice-0.3.2.tar.gz.

File metadata

  • Download URL: dice-0.3.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dice-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c2bb33ef7c92dafb0014a516e32dc4a53802e84489dc56e7cc9de75e56b5b825
MD5 098ed01bc3688dbd8552fd42a41d2edf
BLAKE2b-256 8fe664afdde66c4d37c493d3e41eb744533c466ea8a4aef9463e984d9926e03d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page