diff --git a/rslib/src/notetype/cardgen.rs b/rslib/src/notetype/cardgen.rs index 5f99a12f6..cd264dfea 100644 --- a/rslib/src/notetype/cardgen.rs +++ b/rslib/src/notetype/cardgen.rs @@ -345,7 +345,7 @@ impl Collection { fn random_position(highest_position: u32) -> u32 { let mut rng = StdRng::seed_from_u64(highest_position as u64); - rng.gen_range(0..highest_position.max(1000)) + rng.gen_range(1..highest_position.max(1000)) } #[cfg(test)] @@ -355,8 +355,8 @@ mod test { #[test] fn random() { // predictable output and a minimum range of 1000 - assert_eq!(random_position(5), 179); - assert_eq!(random_position(500), 12); + assert_eq!(random_position(5), 180); + assert_eq!(random_position(500), 13); assert_eq!(random_position(5001), 3731); } }