Greetings:
I'm helping code a php site that takes six arrays each having up to seven elements, and finds every possible combination of those arrays.
For background, this is going to be used for a basketball tourney (5 players and an alt makes 1 team) with each player having seven attributes (player age, height, experience, etc.)
What's needed is a way to get all possible combinations with one player from each team, and then to take those combinations and rank them according to a set of rules (like "team with the most years experience", "team with the shortest players", "team with highest average age", et al.)
There are two 'catches': 1) not all teams have six members, and 2) not all attributes of the players will be known ahead of time.
Does anyone know of a function (or may have had to write something similar) that can take multiple, differently-sized arrays, calculate all possible permutations, and place the resulting combinations in a third array without using nested loops?
If not, any insight into the easiest way to accomplish this would be helpful. I'm looking for ideas here, not finished code...any assistance would be greatly appreciated!