啥?为啥不一样?因为我改了源码。
[pre lang="Ruby"]class Test
def self.test(string,&block)
time = Time.new
block.call
puts string,Time.new-time
end
end
class Point
attr_accessor :x, :y
def initialize(x, y)
@x = x
@y = y
end
def ==(point)
return @x==point.x && @y==point.y
end
end
class Array
def point_include?(point_arr)
self.each do |point|
return true if point[0] == point_arr[0] && point[1] == point_arr[1]
end
return false
end
end
point1 = Array.new
point2 = Array.new
max = 5000000