Ruby - Statement until loop

Introduction

until provides the opposite functionality, looping until a certain condition is met:

Demo

x = 1 
until x > 99 # from ww w. j ava  2s. co  m
 puts x 
 x = x * 2 
end

Result

Related Topics