Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frolov-andrey2405/dice_thrower


https://github.com/frolov-andrey2405/dice_thrower

Last synced: about 19 hours ago
JSON representation

Awesome Lists containing this project

README

        

# Dice_thrower

In games like Dungeons & Dragons and other tabletop role-playing games special dice with 4, 8, 10, 12 and even 20 faces are used. In these games, it is common to use special designations for the rolls of the various dice. For example, "3d6" means a roll of three six-sided dice, and "1d10+2" means a roll of one ten-sided dice with an added bonus of two points. The program below simulates such dice rolls in case you don't have physical dice on hand. It can also simulate rolls of even non-existent physical dice, such as 38-sided dice.

## How to Use

1. Run the program in a compatible environment.
2. Input the dice roll in the format "NdM", where N is the number of dice and M is the number of sides on each die.
3. Optionally, you can add a bonus or modifier by using "+X" or "-X" (where X is the modifier).
4. Watch as the program simulates the dice roll and displays the result.

## Features

- Simulate dice rolls commonly used in tabletop role-playing games.
- Customize rolls with various dice types, modifiers, and bonuses.
- Experience the excitement of dice throws without needing physical dice.

## Instructions

1. Open a terminal or command prompt.
2. Navigate to the program's directory.
3. Run the program using `python dice_thrower.py`.
4. Input the desired dice roll in the format "NdM" and optional modifiers.

## Sample Output
```
Input: `3d6+2`
Output: `Total: 16 (Each die:6, 2, 6, +2)`
```