Struct urandom::distributions::Dice
source · pub struct Dice(_);
Expand description
Standard uniform dice.
Examples
use urandom::distributions::Dice;
let mut rng = urandom::new();
let sum: i32 = rng.samples(Dice::D6).take(2).sum();
assert!(sum >= 1 && sum <= 12);
Implementations
sourceimpl Dice
impl Dice
sourcepub const D4: Dice = _
pub const D4: Dice = _
4-sided dice.
The Caltrop, always lands with the point face up. This dice is numbered 1-4.
sourcepub const D6: Dice = _
pub const D6: Dice = _
6-sided dice.
Is the standard cube-shaped dice, not only used in D&D, but different card and dice game as well.
sourcepub const D8: Dice = _
pub const D8: Dice = _
8-sided dice.
Is the eight-sided dice which used heavily for different strategies, at different points of gameplay.
sourcepub const D10: Dice = _
pub const D10: Dice = _
10-sided dice.
Used heavily, and a combination of two dice can result in moves 1 - 100.
sourcepub const D20: Dice = _
pub const D20: Dice = _
20-sided dice.
The signature dice of the dungeons and dragons game is the twenty sided dice. Is used most often in the game, and is the dice which is going to determine all of the strategies and attacks which will be used during game play by players. Also used to determine saving rolls during game play.
Trait Implementations
sourceimpl Distribution<i32> for Dice
impl Distribution<i32> for Dice
impl Copy for Dice
Auto Trait Implementations
impl RefUnwindSafe for Dice
impl Send for Dice
impl Sync for Dice
impl Unpin for Dice
impl UnwindSafe for Dice
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more