エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
書きかけで放置していたのを完成させました class HQ9Plus def initialize(source) @source = source @c... 書きかけで放置していたのを完成させました class HQ9Plus def initialize(source) @source = source @count = 0 end def run @source.each_char do |c| case c when "H" hello when "Q" source when "9" bottles when "+" count end end end private def hello puts "Hello World" end def source puts @source end def count @count += 1 end def bottles 99.downto(0) do |i| beforeBottles = "#{i} bottle" afterBottles = "#{i-1} bottle" action