Okay, training wheels off. Let’s see your stuff!
i = 3 while i > 0 do print i i -= 1 end
- In the above example, we create a variable called
iand set it to
- Then, we print out
321since we execute the loop as long as
while loop to
puts, and don’t forget to increment your variable.