Skip to main content

Hello Worlddice throwing setup process for nbdev

Project description

nbdev-hello-world

This is a simple dice throwing class that uses NumPy default_rng to build an array of random integers depending upon the number of sides on the dice and the number of dice thrown.

Install

pip install nbdev-hello-dice

How to use

Here, we throw 1 die with 6 sides:

result = throw(6)
result
1 = sum([1])

Next, we can throw $\times 2$ dice and look at the sum

throw(6, 2)
3 = sum([1 2])

The dice values are stored in an array, as throw(N, inhand).dice as such

result = throw(6, 4)
result.dice
array([2, 1, 4, 6])

The sum of the dice values are saved in throw.(N, inhand).sum as such

result.sum
13

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

nbdev-hello-dice-0.0.2.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

nbdev_hello_dice-0.0.2-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

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