stepping back to chapter 7 for a bit

This commit is contained in:
Dan Buch 2011-10-06 21:50:45 -04:00
parent 0bca534c3e
commit 66fa87808c

15
cookbook/007/intro.rb Normal file
View File

@ -0,0 +1,15 @@
[1, 2, 3].each { |i| puts i }
[1, 2, 3].each do |i|
if i % 2 == 0
puts "#{i} is even."
else
puts "#{i} is odd."
end
end
1.upto 3 do |x|
puts x
end
1.upto(3) { |x| puts x }