ruby 冲击波:
x = 0
loop do
puts '-' * ((1 + Math.sin(x += 0.1)) * 20)
sleep 0.01
end
一道 Ruby 水平自测题
class Class
def to_proc
proc {|x,y| new x, y }
end
end
[[1, "a"], [2, "b"], [3, "c"]].map(&Array) # => 请使用 Ruby 1.9 以上版本, 说出你的答案.