Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (tye)Re2: Finding all Combinations

by redbeard (Beadle)
on Sep 11, 2002 at 18:36 UTC ( [id://197105]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to (tye)Re2: Finding all Combinations
in thread Finding all Combinations

Indeed - I'm not as familiar with binary, so I'll have to ponder a bit, but thanks! I was working on this problem and was working on an algorithm that would iterate through all combos, but the checking back to see if you were REALLY done once you had reached the end of a set was killer for large sets (e.g. 30)...

Replies are listed 'Best First'.
(tye)Re3: Finding all Combinations
by tye (Sage) on Sep 12, 2002 at 01:43 UTC

    Change the while condition to:     while( 9 < ++$pick[$i]  ) { and the return statment to     return reverse @pick; and it will count in base 10. Perhaps that will make it easier to understand what it was doing.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://197105]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.