#dice-roll #gamedev #random #game

dwat20

A Rust crate for emulating dice rolls

1 unstable release

0.1.0 Dec 23, 2023

#1818 in Game dev

MIT license

3KB

Dwat20

Dwat20 is a Rust crate to emulate dice rolls for my projects.

Planned Features

Features will be added to this section as they come up in my other projects.

  • Roll can return success or failure.
  • Roll can return total value of multiple dice.
  • Roll can return number of successes of multiple dice.
  • Augment roll with modifiers.
  • Option to explode dice rolls.
  • Option to use Vectors for representing side faces.

Documentation

To install Dwat20 run:

cargo install dwat20

Examples

A simple d20:

use dwat20::*;

fn main() {
    let die = Die::new(20);

    println!("Die result: {}", die.roll())
}

Output:

Die result: 7

Dependencies

~315KB