Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def foo(x, y)
- if x == y
- 1
- else
- 0
- end
- end
- f = [1, 2, 3, 4, 5]
- g = [1, 2, 3, 4, 5]
- r = 1
- f.each do |i|
- r *= foo(f[i], g[i])
- end
- if r == 1
- puts "f and g are copies"
- else
- puts "f and g are not copies"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement