Monster/Math

Monster/Math

Source:
Author:
  • schukai GmbH

Methods

(static) random(min, max) → {number}

Source:
Since:
  • 1.0.0

this function uses crypt and returns a random number.

you can call the method via the monster namespace Monster.Math.random().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/math/random.js';
console.log(Monster.Math.random(1,10)) // ↦ 5
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/math/random.js';
console.log(random(1,10)) // ↦ 5
</script>
Parameters:
Name Type Description
min number

starting value of the definition set (default is 0)

max number

end value of the definition set (default is 1000000000)

Returns:
Type
number