Ruby supports a number of ways of counting and looping:
1.upto(10) do |i| puts iend>> 1.upto(10) do |i| > puts i| end #=> 112345678910
There's also step
instead of upto
which allows you to increment by a step value:
>> 1.step(10,2) { |i| puts i } 13579