🎲

DnD Dice

Python32 lines· 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.
Original project by @Ramisky — view source on GitHub
Ready when you are

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.

How to run

python main.py

Requires Python 3.10+ (uses the match statement).

Dependencies

Standard library only (random).

Pyodide-runnable

Yes — it is a pure-stdlib console program using input, print, and random.

dnd-dice.py· Python 3.x
35 lines
Console· terminal