DevHeads.net

Postings by derrick

ruby beginner help

I am having a lot of trouble wrapping my head around this
I have an array of arrays of prime numbers.
I want to add a each prime number to this array.
example
I have

prime_ary = [[3, 5], [3, 7], [3, 11], [5, 11]]
add_ary = [57, 91, 109]

I would like to get an array of arrays like this

[[3,5, 57], [3, 7, 57], [3, 11, 57], [5, 11, 57], [3, 5, 91], [3, 7, 91], [3, 11, 91] ... ]
There should be 12 sub arrays in the array at the end. I have this function in an array class but it doesn't give me the result I would like.