Crates.io | shuffle |
lib.rs | shuffle |
version | 0.1.7 |
source | src |
created_at | 2019-10-01 17:33:26.105251 |
updated_at | 2021-09-30 17:48:48.62729 |
description | Implementation of various shuffling algorithms over slices. |
homepage | |
repository | https://github.com/adambudziak/shuffle |
max_upload_size | |
id | 169150 |
size | 12,367 |
Various shuffling algorithms for rust.
use shuffle::shuffler::Shuffler;
use shuffle::irs::Irs;
use rand::rngs::mock::StepRng;
let mut rng = StepRng::new(2, 13);
let mut irs = Irs::default();
let mut input = vec![1, 2, 3, 4, 5];
irs.shuffle(&mut input, &mut rng);
assert_eq!(&input, &[4, 1, 5, 3, 2]);