Skip to main content

Module to roll multiple dice.

Project description

Dice rolling

This module aims to implement the throw of many types of dice.

Installation

Simply run:

pip install dice_rolling

CLI usage

Once installed, a throw of a simple die of 6 sides can be performed with:

roll 1d6

Or, for instance, to throw three 20-sided dice can be as simple as:

roll 3d20

Module usage

To use this module you should use the class RollBuilder to implement the throws:

from dice_rolling import RollBuilder

builder = RollBuilder()
builder.set_amount_of_dice(3)
builder.set_number_of_sides(20)
builder.build()

print(builder.get_result())

More methods will be added to the builder in the future.

Throws

Currently it only supports the following throws:

  • xdy: Where x is the number of dice and y the number of faces of each die.

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_rolling-1.0.0.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file dice_rolling-1.0.0.tar.gz.

File metadata

  • Download URL: dice_rolling-1.0.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.0

File hashes

Hashes for dice_rolling-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c9a7eb3fbf6d83f0a670391da9d764db1f9adadb4b4e09b314b03d0d545d1c26
MD5 354ff3235ddc90802854554db2bf14a0
BLAKE2b-256 b42e3248117cb5d5a5c2540307aad39897a2a193ae5beecfff0b8c7dda523d38

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