repeating random number sequences.

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Aug 28 10:52:49 PDT 2013


On Wed, Aug 28, 2013 at 06:18:01PM +0200, Jesse Phillips wrote:
> On Tuesday, 27 August 2013 at 12:59:19 UTC, Jason den Dulk wrote:
> >Hi
> >
> >This code
> >
> >  foreach (j; 0..5)
> >    writeln(rndGen().take(5));
> >  writeln(uniform(0, 1024));
> >  foreach (j; 0..5)
> >    writeln(rndGen().take(5));
> 
> What monarch said, though std.range.refRange() may be of interest:
> 
> http://dlang.org/phobos/std_range.html#.refRange

That currently doesn't work too well if you use any RNG members other
than the standard range API, due to:

	http://d.puremagic.com/issues/show_bug.cgi?id=10888


T

-- 
Ignorance is bliss... until you suffer the consequences!


More information about the Digitalmars-d-learn mailing list