Skip to content

Instantly share code, notes, and snippets.

@puyo
Created April 27, 2012 10:01
Show Gist options
  • Save puyo/2508069 to your computer and use it in GitHub Desktop.
Save puyo/2508069 to your computer and use it in GitHub Desktop.
Eulalie's first program
#/usr/bin/env ruby
COLORS = [
RED = "\e[01;31m",
GREEN = "\e[01;32m",
YELLOW = "\e[01;33m",
BLUE = "\e[01;34m",
PINK = "\e[01;35m",
CYAN = "\e[0;36m",
GRAY = "\e[01;30m",
]
RESET="\e[0m"
characters = ['\\', '|', '/', '-']
characters = ['_', '.', '-', '^', '^', '-']
characters = 'Eulalie'.split('')
3.times{ puts }
i = 0
10.times do
print ' '
21.times do
print "\x08"
print "#{COLORS[rand(COLORS.size)]}#{characters[i]}#{RESET} "
$stdout.flush
i = (i + 1) % characters.size
sleep 0.1
end
puts
end
3.times{ puts }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment