Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created December 11, 2012 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rummelonp/4255848 to your computer and use it in GitHub Desktop.
Save rummelonp/4255848 to your computer and use it in GitHub Desktop.
テキストをグリッチ(参考: http://nekogata.hatenablog.com/entry/2011/11/13/040535
# -*- coding: utf-8 -*-
class Glitch
GLITCH_CHARS = ("\u0300".."\u036f").to_a
def self.glitch(string)
string.each_char.reduce("") do |r, c|
r + c + rand(2).times.map { GLITCH_CHARS.sample }.join('')
end
end
end
puts Glitch.glitch(ARGV.join(' '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment