Idiom # 69: Seed random generator
Random number generators in Fuzion are effects. To use a random number
generator with a particular seed, we have to instate the effect
Random with the given seed and run code with this effect in its
environment. The standard library feature Random.simple creates
such a random provider with the given seed and installs it as the environment
for running the code provided with the function parameter f.
Code
Runnable Example
The following example provides a feature seed that executes a
function f with in an environment with a seeded random number
generator. For illustration, show_random is called in this context
and also in the default random provider and an explicitly time seeded random
provider: