Files
Digpkg/math/docs/random/random.md
2026-01-23 16:47:56 +11:00

563 B

math_Random

Generate a random integer in the range provided.
IMPORTANT: math_Random is NOT cryptographically secure! Use the cryptography library instead!
If you want to generate a random double, use math_RandomDouble.

Arguments

  • min (int): Smallest possible number
  • max (int): Largest possible number

Returns

randomNumber (int): A random number in the range provided

Example

call !math_Random 1 6 &dice
println $dice # 3
call !math_Random 1 6 &dice
println $dice # 2
call !math_Random 1 6 &dice
println $dice # 6
...