write a subroutine that takes N arrayrefs and combines them in the following way:
So, basically, all combinations that can be made using one and only one item from each array at each level.([1,2],[3,4],[5,6]) would combine as: 1 3 5 2 3 5 1 4 5 2 4 5 1 3 6 2 3 6 1 4 6 2 4 6
the subroutine should return a list of array references of the combination (i.e. output for ([1],[2,3]) would be ([1,2],[1,3])) or if it is easier, a reference to an array of such references.
- Ant
- Some of my
best work - (1 2 3)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (GOLF) combine N arrays
by japhy (Canon) on Apr 15, 2002 at 20:23 UTC | |
by lshatzer (Friar) on Apr 15, 2002 at 20:41 UTC | |
by suaveant (Parson) on Apr 15, 2002 at 20:50 UTC | |
by belg4mit (Prior) on Apr 15, 2002 at 23:56 UTC | |
|
Re: (GOLF) combine N arrays
by jynx (Priest) on Apr 16, 2002 at 21:22 UTC |