Ruby - Statement until loop

Introduction

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

Demo

x = 1 
until x > 99 #  w  w  w .  ja  va 2s.  c o m
 puts x 
 x = x * 2 
end

Result

Related Topics