view 1-Ruby/blocks.rb @ 38:e8407d4e72dd

Add code on reflection - basically involves the object returned by "proto" message
author IBBoard <dev@ibboard.co.uk>
date Wed, 13 Sep 2017 20:11:52 +0100
parents 0374ae06729e
children
line wrap: on
line source

#! /usr/bin/env ruby

x = 1

# Inline loops
x = x + 1 while x < 10
puts x

x = x - 1 until x == 1
puts x

# Conventional loops
while x < 10
	x = x + 1
end
puts x

until x == 1
	x = x - 1
end
puts x