like while, you have another form you can use with untila€¡±that is, with begin/end: : until « Statement « Ruby






like while, you have another form you can use with untila€¡±that is, with begin/end:


weight = 150

begin
  puts "Weight: " + weight.to_s
  weight += 5
end until weight == 200

 








Related examples in the same category

1.Here's the formal specification for the until loop:
2.until keeps looping while its condition remains false, or not true.
3.As unless is a negated form of if, until is really a negated form of while.
4.until loops until a certain condition is met
5.unless and until