CODEPREP
timesメソッド 整数.timesで整数分のループを続ける timesメソッドの書き方 10.times do puts "Hi there!" end #結果 Hi there! Hi there! Hi there! Hi there! Hi there! Hi there! Hi there! Hi there! Hi there! Hi there!
until分 「でない限り」ループを続ける falseの場合だけループを続ける。whileの反対 i += 1のように増やさないとだめ untilの書き方 i = 0 until i >= 10 puts i i += 1 end