I will settle with this:

class MyArray
  def count
  a = [1,2,3]
  b = [0.5,0.25]
  num = a.length
  i = 0
  c = []
    while i < num do
      c << b.collect {|x| x * a[i]}
      i += 1
    end
  puts c
  end
end

number = MyArray.new
number.count


that way it does matter if I change the length of a.

thanks again.

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