Johan De Graeve
Systems Engineer
Hi All,
I wish to create array @c from arrays @a and @b
@a = (1, 2, 3)
@b = ("a", "b");
In @c I want all values of @a with all possible combinations of @b
@c = (
[ [1,"a"], [2,"a"], [3,"a"] ]
, [ [1,"a"], [2,"a"], [3,"b"] ]
, [ [1,"a"], [2,"b"], [3,"a"] ]
, [ [1,"b"], [2,"a"], [3,"a"] ]
, [ [1,"b"], [2,"b"], [3,"a"] ]
, [ [1,"b"], [2,"b"], [3,"b"] ]
)
What would we be the best way to accomplish this?
Thanks for helping out.
Johan
I wish to create array @c from arrays @a and @b
@a = (1, 2, 3)
@b = ("a", "b");
In @c I want all values of @a with all possible combinations of @b
@c = (
[ [1,"a"], [2,"a"], [3,"a"] ]
, [ [1,"a"], [2,"a"], [3,"b"] ]
, [ [1,"a"], [2,"b"], [3,"a"] ]
, [ [1,"b"], [2,"a"], [3,"a"] ]
, [ [1,"b"], [2,"b"], [3,"a"] ]
, [ [1,"b"], [2,"b"], [3,"b"] ]
)
What would we be the best way to accomplish this?
Thanks for helping out.
Johan