1
0
Fork 0
lrthw/exercises/ex33.rb

20 lines
321 B
Ruby
Raw Normal View History

2023-09-30 13:20:59 +00:00
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