20 lines
321 B
Ruby
20 lines
321 B
Ruby
def generate_numbers(max, inc)
|
|
numbers = []
|
|
(0..max - 1).step(inc) do |i|
|
|
puts "At the top i is #{i}"
|
|
numbers.push(i)
|
|
|
|
puts "Numbers now: ", numbers
|
|
puts "At the bottom i is #{i}"
|
|
end
|
|
|
|
numbers
|
|
end
|
|
|
|
numbers = generate_numbers(10, 2)
|
|
|
|
puts "The numbers: "
|
|
numbers.each do |number|
|
|
puts number
|
|
end
|