1
0

Make random ranges inclusive

This commit is contained in:
Jeff 2023-10-17 13:28:35 -04:00
parent 35cb8116b6
commit deb03ed1b6

View File

@ -136,7 +136,7 @@ impl Tool {
Value::Integer(random()) Value::Integer(random())
} else if values.len() == 2 { } else if values.len() == 2 {
let mut rng = thread_rng(); let mut rng = thread_rng();
let range = values[0].as_int()?..values[1].as_int()?; let range = values[0].as_int()?..=values[1].as_int()?;
let random = rng.gen_range(range); let random = rng.gen_range(range);
Value::Integer(random) Value::Integer(random)