diff options
author | David Gay <eapoems@riseup.net> | 2023-10-01 02:34:16 -0400 |
---|---|---|
committer | David Gay <eapoems@riseup.net> | 2023-10-01 02:34:16 -0400 |
commit | b77f46d0146d6b5b9acdb23546db2d57c37ed2af (patch) | |
tree | ad13966380074bd581ce9efac956f65a38393095 /src/dice.rs | |
parent | 8bc79457594a01f22f7146d3e1855de54558c531 (diff) |
Draft of random tables
Diffstat (limited to 'src/dice.rs')
-rw-r--r-- | src/dice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dice.rs b/src/dice.rs index ffec3b8..64a4635 100644 --- a/src/dice.rs +++ b/src/dice.rs @@ -21,7 +21,7 @@ pub struct RollResult { } impl RollResult { - fn new() -> Self { + pub fn new() -> Self { RollResult { rolls: Vec::new(), } @@ -31,7 +31,7 @@ impl RollResult { self.rolls.push(roll) } - fn total(&self) -> u32 { + pub fn total(&self) -> u32 { self.rolls.iter().map(|die_roll| die_roll.face).sum() } } |