09-19-2011 09:45 AM
Hello,
I'm trying to create a list of all possible combinations of 1 array (2D). I have 3 elements/row:
Array:
a b c
1 2 3
A B C
* + {
Result:
a a a a a ...
1 1 1 1 1 ...
A A A B B ...
* + { * + ...
Any idea?
Thank you.
09-19-2011 10:10 AM
Test size of each dimension and use the rotate array primitive.
Have fun!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
09-19-2011 10:45 AM
hmm, maybe rotate is not the best idea.. here's a quick throw in for if you have just 2 sets of characters, hope it inspires you.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
09-19-2011 10:50 AM
thank you,
09-19-2011 10:58 AM
By the way, if you want to be able to handle any number sets of chars, you will have to create a recursive algorithm, I think.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus