Make random ranges inclusive
This commit is contained in:
parent
35cb8116b6
commit
deb03ed1b6
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user