use while and until in a single line setting, as with if and unless: : Until as modifier « Statement « Ruby






use while and until in a single line setting, as with if and unless:

i = 1
i = i * 2 until i > 1000
puts i

 

Related examples in the same category