Created
October 20, 2018 18:29
-
-
Save rust-play/b509d2bbbe14011d764c03dbe439936f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate rand; | |
fn main() { | |
use rand::{Rng, SeedableRng}; | |
let mut rng = rand::prng::XorShiftRng::from_seed ([ | |
0x19, 0x3a, 0x67, 0x54, | |
0xa8, 0xa7, 0xd4, 0x69, | |
0x97, 0x83, 0x0e, 0x05, | |
0x11, 0x3b, 0xa7, 0xbb | |
]); | |
for _ in 0..10 { | |
println!("{}", rng.gen_range(-10.0, 10.0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment