Generate array of random values

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Aug 1 12:43:13 PDT 2011


Actually I don't really need *uniform* distribution, it's just that
when porting C code to D I didn't find any obvious random()/rnd()
functions, and uniform seemed to be the closest thing without having
to mess around with a bunch of randomization parameters which I don't
care about.

I don't see how we can claim D to be an elegant language with this mess:
array(map!"a % 1024"(take(rndGen(), 1024)))

That's just damn *horrible*.


More information about the Digitalmars-d-learn mailing list