制御構文

#if sample
if x < 10 && x > 5
    puts "xは10より小さく、5より大きい"
elsif x % 2 == 0
    puts "xは偶数"
else
    puts "xはその他の数"
end 
#each sample
#eachメソッドにブロック({〜}部分)を渡して、その中に繰り返したい内容を記述する。
names = ["太郎", "花子", "次郎"]
names.each{|name|
    print "あなたの名前は、", name, "さんですね。\r\n"
}
#for sample
#繰り返しのための構文
foods = ["お肉", "カボチャ", ""]
for food in foods
    print "あなたの食べたいものは、", food, "ですね\r\n"
end
#while sample
i = 0
while i < 10
    puts i
end