=begin joke. 「Samurai:」節を修飾 ref; http://www6.plala.or.jp/private-hp/samuraidamasii/ =end class Filter def samuraizer(str, type) case type when :P #「Samurai:」ネタ str.gsub!(/^Samurai:(?: (-.*))?(\n(.*))*/i){ param = $1 str.gsub!(/^Samurai:(?: (-.*))?\n/i, "") tmpstr = str.scan(/.*?[、。\n]|/s) newstr = '' tmpstr.each { |tmp| color = ["white", "white", "red", "blue", "yellow"][rand(5)] size = '' height = '
' * rand(5) tmp = tmp.strip.chomp.to_s $stderr.puts ':::' + Kconv.tosjis(tmp) + ':::' newstr << size + tmp.chomp.strip.to_s + '
' + height } str = "
" + newstr + "
" } end end end