Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Idiom # 70: Use clock as random generator seed

See programming-idioms.org:

Random numbers generators in Fuzion are effects. To use a random number generator seeded by a clock, we can use the standard library feature time_seeded_random which installs a time seeded random number generator into the current environment for running the code provided with the function parameter f.

Code

Running Example

The following example calls showRandom in the context of an explicitly time seeded random provider: