2019-08-16 09:45:06 +08:00
|
|
|
# rand
|
|
|
|
|
|
|
|
Random number generator. Generates a pseudo random number.
|
|
|
|
|
2019-08-24 10:13:25 +08:00
|
|
|
**Since:** 2.1
|
|
|
|
|
2019-08-16 09:45:06 +08:00
|
|
|
## Parameters
|
|
|
|
|
2019-08-16 09:50:38 +08:00
|
|
|
- `min_value` : Minimum value of random number range. Default to 0.
|
|
|
|
- `max_value` : Maximum value of random number range. Default to 1.
|
2019-08-16 09:45:06 +08:00
|
|
|
- `seed_value` : Optional. Seed value for random number generator for repeatable results.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2020-01-28 17:51:20 +08:00
|
|
|
use <util/rand.scad>;
|
2019-08-16 09:45:06 +08:00
|
|
|
|
|
|
|
echo(rand());
|
|
|
|
echo(rand(1, 10));
|
|
|
|
echo(rand(seed_value = 4));
|
|
|
|
|
|
|
|
|