Let's say I have the following arrays of strings:
Background = {"Ocean"}
Body = {"Normal"}
Eyes = {"Big", "Small", "Monolid"}
Color = {"Yellow", "White", "Red Rose", "Turquoise", "Dark green", "Orange"}
Hands = {"None", "Robot", "Spider", "Bear"}
Extra = {"Empty", "Sand", "Dust", "Graffiti", "Aloe"}
I want to print a list that contains all possible permutations of each element mentioned in the arrays above, following the order in which these arrays were set (i.e. it starts checking on Background, then goes to check Body, then Eyes, then Color, then Hands, and finishes on Extra).
The first permutation should be:
1. Ocean, Normal, Big, Yellow, None, Empty
The second permutation should be:
2. Ocean, Normal, Big, Yellow, None, Sand
And so on...
It can be assumed that the item None is the same as Empty.
How could I do that?
i, also, do you know if there's a formula I could use to check if the final number ofiis really the total number of permutations for this case?iin that case will definitely be the total number of permutations. For my suggested solution, you can just get the length of the resulting list and compare that to your finaliin accepted answer. If they are the same, you can then just use the fastest option.