http://builder.japan.zdnet.com/sp/ruby-doukaku-panel/story/0,3800086254,20369264,00.htm
引数のデフォルト値って、これいいのかなぁ?
def asm(seq, head = seq.first, i = seq.first) if seq.first == i asm(seq.slice(1..-1), head, i + 1) else [[head, i - 1].uniq] + (seq.empty? ? [] : asm(seq)) end end puts asm(ARGV[0].split(/ +/).map {|i| i.to_i }).map {|i| i.join('-') }.join(',') + '.'