Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Generate all possibilities

by Madams (Monk)
on Jun 23, 2001 at 05:47 UTC ( #90914=note: print w/ replies, xml ) Need Help??


in reply to Generate all possibilities

I had a similar question awhile back about using a dynamic number of nested for loops (Topic thread here,tilly's answer here).

I wanted to loop through x sets of items and process the combinations:

i.e.: the sets {1,2,3},{a,b,c},{!@#} yield (inorder) 1a!, 1a@, 1a#, 1b!, 1b@, 1b#...3c#

tilly's answer had it all AND made me REALLY understand closures and iterators and how powerfull they really are.


_________________
madams@scc.net

(__) (\/) /-------\/ / | 666 || * ||----||


Comment on Re: Generate all possibilities
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://90914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-07-26 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls