Skip to content

A lightweight and flexible Python tool for simulating dice rolls, perfect for tabletop games, RPGs, and probability testing.

Notifications You must be signed in to change notification settings

akashrana7/dice-roller

Repository files navigation

🎲 Dice Roller

Dice Roller

Welcome to the Dice Roller repository! This lightweight and flexible Python tool simulates dice rolls, making it perfect for tabletop games, RPGs, and probability testing. Whether you are rolling a D20 for your next Dungeons & Dragons session or just curious about dice probabilities, this tool has you covered.

Table of Contents

Features

  • 🎲 Multiple Dice Types: Roll different types of dice, including D4, D6, D8, D10, D12, and D20.
  • ⚙️ Flexible Configuration: Customize the number of dice and the sides for each roll.
  • 📊 Probability Testing: Analyze the likelihood of various outcomes.
  • 🖥️ Command-Line Interface: Easy to use from the terminal.

Installation

To install the Dice Roller, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/akashrana7/dice-roller.git
    cd dice-roller
  2. Install Dependencies:

    Make sure you have Python installed. You can install the required packages using pip:

    pip install -r requirements.txt

Usage

After installation, you can start using the Dice Roller tool directly from your command line. The basic command structure is:

python dice_roller.py [options]

Commands

Roll a Single Die

To roll a single die, use the following command:

python dice_roller.py roll D6

This command rolls a six-sided die.

Roll Multiple Dice

To roll multiple dice, you can specify the number of dice and the type:

python dice_roller.py roll 3D20

This command rolls three twenty-sided dice.

Probability Analysis

You can analyze the probability of rolling a specific number with a certain die:

python dice_roller.py probability D10 7

This command checks the probability of rolling a 7 on a ten-sided die.

Examples

Here are some examples of how to use the Dice Roller:

  1. Rolling a D20:

    python dice_roller.py roll D20

    Output:

    You rolled a 14 on a D20!
    
  2. Rolling Multiple D6:

    python dice_roller.py roll 5D6

    Output:

    You rolled: [3, 5, 2, 6, 1]
    Total: 17
    
  3. Probability Testing:

    python dice_roller.py probability D4 2

    Output:

    The probability of rolling a 2 on a D4 is 25%.
    

Contributing

We welcome contributions to improve the Dice Roller tool. If you want to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your changes to your fork.
  5. Submit a pull request.

Please ensure your code follows the style guidelines and includes tests where applicable.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, feel free to reach out:

Releases

To download the latest version of Dice Roller, visit the Releases section. Here, you can find the latest files that need to be downloaded and executed.

You can also check the releases for updates and new features.

Release Badge


Thank you for checking out the Dice Roller! Enjoy your gaming experience, and may the odds be ever in your favor!

About

A lightweight and flexible Python tool for simulating dice rolls, perfect for tabletop games, RPGs, and probability testing.

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •