Last active
November 9, 2015 20:38
-
-
Save weapp/86fea9680ed2b4ee4826 to your computer and use it in GitHub Desktop.
This message will self destruct
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
str = " [ = This message will self destruct = ]" | |
wave = -> max { [*0.upto(max), *max.downto(0)] } | |
puts | |
wave[str.length].each do |char| | |
sleep(0.05) | |
print "\r\e[2K#{str[0..char]}" | |
end | |
print "\e[M\e[1A\r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment