Closed tukib closed 2 months ago
The examples for the scripts.lib RNG methods do not show how to generate a random value.
Affects:
LCG current:
function(context, args) { const l = #fs.scripts.lib(); my_seed = 12345; return l.LCG(my_seed); }
LCG example improvement:
function(context, args) { const l = #fs.scripts.lib(); const seed = 12345; const rng = l.LCG(seed); const random_value = Math.floor(rng() * 10) // random value from 0 (inclusive) to 10 (exclusive) return random_value }
Problem
The examples for the scripts.lib RNG methods do not show how to generate a random value.
Context
Affects:
LCG current:
LCG example improvement: