Created
April 15, 2014 05:18
-
-
Save ddrscott/10704146 to your computer and use it in GitHub Desktop.
My son wanted to see colorful letters. This is what I came up with. He actually stayed awake as I type it. It was originally a one liner done in IRB.
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
az=("A".."z").to_a.map {|m| | |
"\033[38;5;#{rand(180)+16}m#{m}\033[0m" # wrap char in random color | |
} | |
loop { | |
puts [az*" "] * 25 # fill some of the screen | |
az<<(az.shift) # rotate chars | |
sleep(0.3) # slow down | |
puts "\e[26F" # cursor up 26 lines | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment