Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (21 sloc) 0.349 kb
class Array
def *(other)
r = []
self.each_with_index do |e, i|
r[i] = (e * other[i])
end
r
end
def /(other)
r = []
self.each_with_index do |e, i|
r[i] = (e / other[i])
end
r
end
end
describe "multiplying arrays" do
it "should do simple stuff" do
([1,2] * [3,4]).should == [3,8]
end
end
Jump to Line
Something went wrong with that request. Please try again.