Re: Working with randomSample

2018-12-28 Thread Murilo via Digitalmars-d-learn
On Friday, 28 December 2018 at 03:59:52 UTC, Ali Çehreli wrote: It's because randomSample returns either an input range or a forward range depending both on the kind of range that it gets and the random number generator used. Documented here: Ali Thank you very much, now it all makes sense.

Re: Working with randomSample

2018-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2018 06:06 PM, Murilo wrote: > Why is it that when I type "auto choice = randomSample(array);" and > later when I try to index choice as in choice[1] it gives an error message? It's because randomSample returns either an input range or a forward range depending both on the kind of

Working with randomSample

2018-12-27 Thread Murilo via Digitalmars-d-learn
Why is it that when I type "auto choice = randomSample(array);" and later when I try to index choice as in choice[1] it gives an error message?