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.4.0.tar.gz (6.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for dice-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ec8f1c8b4699712f7eb11af0ccc2a8e7d2b6ac5e7989527a0dd5f9dc64cc48dd
MD5 79f34b6159babcabace139b5c62b6a3e
BLAKE2b-256 344e7b4376b095aac0503949c0fc057c5091999d33afb17f3853c08d1294075f

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