Skip to main content

A simple dice roller library

Project description

Konso's Dice Roller

A simple dice roller library I made for kicks.

Installation

pip install --upgrade konso-dice-roller

Usage


from konso_dice_roller import markdown_roll_string_from_input, roll_string_from_input



if __name__ == '__main__':

    print(roll_string_from_input("2d20+3"))

    print(roll_string_from_input("3d6>=5"))

    print(markdown_roll_string_from_input("3d8-2"))

    print(markdown_roll_string_from_input("2d10=2"))



    result = roll_string_from_input(

        input_string="100d1",

        number_of_dice_limit=50,

        dice_sides_limit=20,

        bonus_absolute_value_limit=1_000,

    )



Example output:


2d20+3, tulos: [10 15] + 3 = 28

3d6>=5, tulos: [3 5 3] = 1

`3d8-2`, tulos: `[3 5 3] - 2 = 9`

`2d10=2`, tulos: `[4 1] = 0`

ValueError: Liian monta noppaa

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

konso_dice_roller-0.0.6.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

konso_dice_roller-0.0.6-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file konso_dice_roller-0.0.6.tar.gz.

File metadata

  • Download URL: konso_dice_roller-0.0.6.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for konso_dice_roller-0.0.6.tar.gz
Algorithm Hash digest
SHA256 913bfe944c0fa4776e1d4f17f30b157eba16514bb9ff0d268504784313eb4dca
MD5 efc33c1e34654f5c92719017cc393cea
BLAKE2b-256 8ecf7e87aef19d1ceb90cbf3f2197720c142c001a7acec489223017cb2f1e993

See more details on using hashes here.

File details

Details for the file konso_dice_roller-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for konso_dice_roller-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6cb4827f8e1bf1f6ca3bd4e5cbfa3d50fd6d527579657b22e1f4303afb9c55e0
MD5 4581a918de5d05922d5143c235ecf619
BLAKE2b-256 37065ef455fcc5429bd43767e3c3cb08dc8e007c1ca0658a393e7c29e825f012

See more details on using hashes here.

Supported by

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