Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate rand;
- use rand::distributions::{Distribution, Uniform};
- fn main() {
- let mut rng = rand::thread_rng();
- let die = Uniform::from(1..7);
- loop {
- let throw = die.sample(&mut rng);
- println!("Roll the die: {}", throw);
- if throw == 6 {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement