Skip to content

Instantly share code, notes, and snippets.

@hiroism007
Created May 1, 2013 09:00
Show Gist options
  • Save hiroism007/5494392 to your computer and use it in GitHub Desktop.
Save hiroism007/5494392 to your computer and use it in GitHub Desktop.
マトリックスのOPみたいな感じをコマンドライン上で表現
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def green; colorize(32); end
end
def like_matrix(size=1)
[*0..9,*'a'..'z',*'A'..'Z'].sample(size).join
end
loop do
print like_matrix.green + " " + like_matrix.green + " "
sleep(0.001)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment