Skip to content

simon-danielsson/slump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slump

Minimal generator of randomness.

Crates.io version MIT License Last commit

InfoUsageLicense


📌 Information

Slump is a minimal randomness generator built for when you need randomness but not precision or uniformity.

Important

If you want something more advanced and full-featured, use rand instead.


💻 Usage

cargo add slump
    fn main() {
        let mut rng = Slump::from_time();

        println!("u32: {}", rng.next_u32());
        println!("f32: {}", rng.next_f32());
        println!("r: {}", rng.gen_range(10));

        let mut items = [1, 2, 3, 4, 5];
        rng.shuffle(&mut items);

        println!("sh: {:?}", items);
    }

📜 License

This project is licensed under the MIT License.