Skip to content

Add more functionality for D20 dice notation #17

@TechnologyClassroom

Description

@TechnologyClassroom

roll.py can take an argument for the number of sides that a die has.

How it currently works: To roll a twenty sided die (D20), you pass the argument like roll(20) to see what the result is. To roll a six sided die (D6), you pass the argument like roll(6) to see what the result is.

In D20 systems that are not Midnight Riders, you commonly need to roll several dice and add a modifier.

The notation to roll eight dice with six sides would be 8D6. The notation to roll four dice with ten sides would be 4D10. The D could also be lower-case such as 4d10.

There is also sometimes a modifier which is a basic math operation such as addition, subtraction, multiplication, or division. The notation to roll three dice with eight sides with additional 4 would be 3D8+4 or 3D8 + 4.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions