Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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.


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

Comment on Re: Generate all possibilities
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2015-11-27 16:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls