Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created October 20, 2018 18:29
Show Gist options
  • Save rust-play/b509d2bbbe14011d764c03dbe439936f to your computer and use it in GitHub Desktop.
Save rust-play/b509d2bbbe14011d764c03dbe439936f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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