I am following this tutorial and read until loops. From the tutorial, I expected to get:
Value of local variable is 1 Value of local variable is 2 Value of local variable is 1 Value of local variable is 2 Value of local variable is 1 Value of local variable is 2 ............................
but I get this instead
Value of local variable is 0
Value of local variable is 1
Value of local variable is 2
This is the code I use, which exactly same with the tutorial
#!/usr/bin/ruby
for i in 0..5
retry if i > 2
puts "Value of local variable is #{i}"
end
Did I miss anything?