Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Factorial Matrix

by ikegami (Patriarch)
on Jan 29, 2008 at 20:00 UTC ( [id://664972]=note: print w/replies, xml ) Need Help??


in reply to Factorial Matrix

That's a cross product, not listing permutations or combinations.

It's trivial with Algorithm::Loops's NestedLoops.

use Algorithm::Loops qw( NestedLoops ); my @array1 = qw( A B ); my @array2 = qw( 1 2 ); my @array3 = qw( C D E ); my $iter = NestedLoops([ \@array1, \@array2, \@array3, ]); while (my @row = $iter->()) { print("@row\n"); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2025-11-13 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (68 votes). Check out past polls.

    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.