How to generate a random number from system clock as seed
monkyyy
crazymonkyyy at gmail.com
Sat Jun 8 21:04:16 UTC 2024
On Saturday, 8 June 2024 at 20:53:02 UTC, Nick Treleaven wrote:
> On Saturday, 8 June 2024 at 16:09:04 UTC, monkyyy wrote:
>> rng is an optional parameter, `uniform(0,100).writeln;` alone
>> works; the docs not telling you that is really bad
>
> They do tell you:
>
>> urng (optional) random number generator to use; if not
>> specified, defaults to rndGen
>
> That overload is used in the 2nd example.
>
> https://dlang.org/phobos/std_random.html#.uniform
generate is a very rare function and do novices understand lamdas?
More information about the Digitalmars-d-learn
mailing list