11 lines
95 B
Ruby
11 lines
95 B
Ruby
|
def each_even(n)
|
||
|
for i in 0...n
|
||
|
yield(2*i)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
each_even(10) do | i |
|
||
|
puts i
|
||
|
end
|
||
|
|