pyBegin / projects / dnd-dice
🎲

DnD Dice

A console dice roller for tabletop role-playing games. Pick a dice type (D4, D6, D8, D10, D12, D20, or D100) and it prints a random roll.

32 linesRunnable

DnD Dice

A console dice roller for tabletop role-playing games. Pick a dice type (D4, D6, D8, D10, D12, D20, or D100) and it prints a random roll.

Example

Pick a Dice type:
1. D4
2. D6
3. D8
4. D10
5. D12
6. D20
7. D100

3
7

(Chose option 3 for a D8; the program printed a random roll of 7.)

How to run on localhost

python main.py

Requires Python 3.10+ (uses the match statement).

Dependencies

Standard library only (random).