Ok... As a warning, my brain is a little lopsided today... Here's the first weird idea that popped into my head... Partly in pseudocode, and haven't tried it out, but here ya go...
private IEnumerable<List<int>> Test(List<List<int>> data)
{
int numDigits = data.Count;
int lastCount = data[numDigits - 1].Count;
int[] indices = new int[data.Count];
while (indices[numDigits - 1] < lastCount)
{
//yield return a list composed of data[0][indices[0]], data[1][indices[1]], ...
indices\[0\]++;
for (int idx = 0; idx < numDigits - 1; idx++)
if (indices\[idx\] == data\[idx\].Count)
{
indices\[idx\] = 0;
indices\[idx + 1\]++;
}
}
}
Bit of a different angle from what you're trying... Instead of going for recursion, think of it like a series of digits. What this really does is count through the following sequence (Assuming all of your arrays have 3 digits): 000, 100, 200, 010, 110, 210, 020, 120, 220, 001, 101, 201... etc And it forms results such that, for example, 120 = the second, third, and first digits of the elements, respectively... Anyway, you get the idea. If you know for a fact that you'll be dealing with 3-digit inner lists, you can simplify this a bit...
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)