Created
March 17, 2020 07:18
-
-
Save max-did-it/2efabf3c695728f791f9b9b6880a6b3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.class_eval do | |
COLORS = { | |
white: "\033[37m", | |
yellow: "\033[33m", | |
green: "\033[32m", | |
blue: "\033[34m", | |
cyan: "\033[36m", | |
red: "\033[31m", | |
magenta: "\033[35m", | |
black: "\033[30m" | |
} | |
OFFCOLOR = "\033[0,0m" | |
def colorize | |
"#{COLORS[COLORS.keys.sample]}#{self}#{OFFCOLOR}" | |
end | |
end | |
loop { s = rand(500..1000).times.map { 10.times.map { rand(40..140).chr }.join('').colorize }.join(''); puts s; sleep(0.04) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment