cours0708/P5B/ruby/each_even.rb

11 lines
95 B
Ruby
Raw Normal View History

2008-11-25 21:11:16 +00:00
def each_even(n)
for i in 0...n
yield(2*i)
end
end
each_even(10) do | i |
puts i
end