There's more than one way to do things | |
PerlMonks |
Re^2: One Zero variants_without_repetition (Al gor loops)by tye (Sage) |
on Aug 07, 2007 at 15:14 UTC ( [id://631072]=note: print w/replies, xml ) | Need Help?? |
... which is available as Algorithm::Loops::NextPermute(). And Algorithm::Loops offers another way to do this as well.
Which is like
Except that the number of ones (and thus the number of nested loops) isn't hard-coded. Update: You can also avoid some looping at the tail end by setting tight top limits:
- tye
In Section
Seekers of Perl Wisdom
|
|