Idiomatic way to generate all possible values a static array of ubyte can have

jkpl via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 2 13:29:02 PDT 2016


On Saturday, 2 April 2016 at 18:32:03 UTC, Steven Schveighoffer 
wrote:
> I honestly think you are better off just generating random 
> arrays, even if it results in some overlap (unlikely to be 
> relevant).
>
> -Steve

Yes I know, I've realized how it's silly. just foreach(xn; 0 .. 
range) foreach(xn; 0 .. range) foreach(xn; 0 .. range) 
foreach(xn; 0 .. range) is enough. But still silly in term of 
complexity. I have to go for a heuristic approach. UNtil that I 
still use a prng.


More information about the Digitalmars-d-learn mailing list