H
Haris Bogdanoviæ
Hi.
I want to multply all elements of two arrays and add that to all elements of
the third array like this:
c+=a*b
c=[1,1,1]
a=[2,2,2]
b=[3,3,3]
c=[7,7,7] # (1+2*3)=7
I tried (found on google):
a.zip(b).map {|i,j| i*j} (don't really know how that works)
and how to add that to c array ?
Thanks
I want to multply all elements of two arrays and add that to all elements of
the third array like this:
c+=a*b
c=[1,1,1]
a=[2,2,2]
b=[3,3,3]
c=[7,7,7] # (1+2*3)=7
I tried (found on google):
a.zip(b).map {|i,j| i*j} (don't really know how that works)
and how to add that to c array ?
Thanks