Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. fn throw_dice(n: u32, faces: u64, total: u64) -> u64 {
  2. ((faces.pow(n) - 1) % total) * (n as u64)
  3. }
  4.  
  5. fn main() {
  6. println!("{}", throw_dice(3, 6, 7));
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement