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 . j  ava 2  s .  c o m
 puts x 
 x = x * 2 
end

Result

Related Topics