I am sure that this has been asked millions of times, but when I looked for all the examples, it didn’t seem like me at all, so I thought I should ask about it anyway.
I have two arrays that will always contain 6 elements each. For instance:
string[] Colors=
new string[] { "red", "orange", "yellow", "green", "blue", "purple" };
string[] Foods=
new string[] { "fruit", "grain", "dairy", "meat", "sweet", "vegetable" };
Between these two arrays there are 36 possible combinations (for example, “red fruit”, “red grain”).
Now I need to further group them into a set of six unique values.
For instance:
meal[0]=
new Pair[] {
new Pair { One="red", Two="fruit" },
new Pair { One="orange", Two="grain" },
new Pair { One="yellow", Two="dairy" },
new Pair { One="green", Two="meat" },
new Pair { One="blue", Two="sweet" },
new Pair { One="purple", Two="vegetable" }
};
where is the food
Pair[][] meal;
No item can be repeated in my list of "dishes". Thus, there is only one “red” element and one “meat” item, etc.
, , .