go ahead... be a heretic | |
PerlMonks |
Re: How can I improve this?by young perlhopper (Scribe) |
on Jul 25, 2000 at 07:14 UTC ( [id://24237]=note: print w/replies, xml ) | Need Help?? |
One thing you could do is simply generate all permutations,
and then sort them. i.e.
This presumes that your only sorting criteria is the number of zeros. But if you have more, just add them to srtsub.
Good luck, p.s. goshdarnit lhoward beat me to it and posted better code. I'm gonna leave mine up though cause i think its a little easier for somebody who (i gather) has a C background to grok.
In Section
Seekers of Perl Wisdom
|
|