Skip to content

Instantly share code, notes, and snippets.

@ali
Last active December 14, 2015 20:19
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 ali/5143317 to your computer and use it in GitHub Desktop.
Save ali/5143317 to your computer and use it in GitHub Desktop.
Yay!
CAKE = <<-OMGCAKE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HAPPY BIRTHDAY, NATE!
OMGCAKE
def get_candles
n = 5
width = CAKE.split("\n")[0].length
spacing = " " * (width/n - 1)
light = ["*", "'", "~"][rand(3)]
lights = ([light] * n).join(spacing).center(width)
candles = (["|"] * n).join(spacing).center(width)
"#{lights}\n#{candles}"
end
while 1
print "\e[2J\e[f" # Clears the terminal
puts get_candles
puts CAKE
sleep(1.0/24.0)
end
@ali
Copy link
Author

ali commented Mar 12, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment