in reply to Combinations / permutations... not even sure what this is called
#!/usr/bin/perl use strict; use warnings; use Math::Combinatorics; my @arrays = ( qw[ red blue ], qw[ small medium large ], qw[ 1 2 3 4 ], ); print "combinations of 4 from: ".join(" ",@arrays)."\n"; print "-----------------------------".("--" x scalar(@arrays))."\n"; print join("\n", map { join " ", @$_ } combine(4,@arrays))."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Combinations / permutations... not even sure what this is called
by JavaFan (Canon) on Oct 29, 2011 at 07:46 UTC |