Skip to content

Instantly share code, notes, and snippets.

@weapp
Last active November 9, 2015 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weapp/86fea9680ed2b4ee4826 to your computer and use it in GitHub Desktop.
Save weapp/86fea9680ed2b4ee4826 to your computer and use it in GitHub Desktop.
This message will self destruct
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