タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

shokosに関するYoshioriのブックマーク (1)

  • RubyでHQ9+ - shokosブログ

    書きかけで放置していたのを完成させました 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

    RubyでHQ9+ - shokosブログ
  • 1