4 releases

0.2.1 Sep 1, 2024
0.2.0 Aug 31, 2024
0.1.1 Aug 28, 2024
0.1.0 Aug 28, 2024

#4 in #dice-rolling

Download history 411/week @ 2024-08-27 23/week @ 2024-09-03 10/week @ 2024-09-10 11/week @ 2024-09-17 10/week @ 2024-09-24 3/week @ 2024-10-01

149 downloads per month

MIT/Apache

6KB
112 lines

Dicebag

This library contains various "dice rolling" functions and traits.

dicebag::DiceExt

Dice rolling is currently implemented only for i32.

Usage

// Some normie dice:
let a = 3.d6();   // 3d6
let b = 10.d10(); // 10d10

// Delta variancy:
let d = 1.0.delta(5);1.0 ± 5%0.95 .. 1.05

// 50% chance of `c` becoming 5 (otherwise 0).
let c = chance_of!(5, 50);

lib.rs:

Dice rolling!

Dependencies

~775KB
~15K SLoC