Although I haven't tested it, I think CountZero's approach avoids dupes: splice removes each spliced element from the @choices source array before the next pick. I like CountZero's approach better because it's simple, doesn't depend on a module, and seems like it would scale well to very large arrays. The only drawback I see is that the source array is mutated. However, I believe there is a large literature base on 'fair' picking, so there's probably an even better solution!
In reply to Re^3: Where is the zero coming from?
by AnomalousMonk
in thread Where is the zero coming from?
by Pauleduc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |