Combination of elements in array

Can someone help me in finding the combination of elements which are in
different arrays

for ex:
array1=["A","B","C","D"]
array2=["1","2","3","4"]
array3=["red","blue","green","yellow"]

the output should be
A 1 red
A 1 blue
A 1 green
A 1 yellow
A 2 red...etc

it should display all the combinations possible

Regards,
Manju

···

--
Posted via http://www.ruby-forum.com/.

In 1.9.2 you can do
array1.product(array2,array3)

···

2011/10/20 Manju M. <manjuvpm12@gmail.com>:

Can someone help me in finding the combination of elements which are in
different arrays

for ex:
array1=["A","B","C","D"]
array2=["1","2","3","4"]
array3=["red","blue","green","yellow"]

the output should be
A 1 red
A 1 blue
A 1 green
A 1 yellow
A 2 red...etc

it should display all the combinations possible

Regards,
Manju

--
Posted via http://www.ruby-forum.com/\.

Thank you Gunther Dieman..

···

--
Posted via http://www.ruby-forum.com/.