tomb 0.2.0

A minimal crate that provides dice rolling mechanisms for games
Documentation
  • Coverage
  • 100%
    34 out of 34 items documented12 out of 12 items with examples
  • Size
  • Source code size: 42.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.34 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • matanlurey/grud
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • matanlurey

tomb

Tomb is a minimal crate that provides dice rolling mechanisms for games.

Rust Checks Coverage Status Current Crates.io Version Docs License: MIT

Examples

// Creating and rolling a D20

// Optional dependency, exclude to implement your own RNG.
use fastrand::Rng;

// It is possible to define your own dice, rollers, and to use immutable die as well!
use tomb::{D20, RngRoller, RollMut};

// Pre-defined seed so the result of this example is predictable.
let roller = RngRoller::from(Rng::with_seed(7194422452970863838));
let mut d20 = D20::new();

roller.roll_mut(&mut d20);
assert_eq!(d20.value(), 10);