How does Velaki's solution use more memory (except maybe for (@a), which could be replaced with for ($j=0; $j<@a; $j++))?
Update: Ah yes, you return an interator instead of building an actual list.
In reply to Re^3: Generating 0 .. N Randomly and Efficiently
by ikegami
in thread Generating 0 .. N Randomly and Efficiently
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |