Skip to content

Instantly share code, notes, and snippets.

@EricLondon
Forked from everm1nd/emoji.rb
Created October 30, 2015 15:03
Show Gist options
  • Save EricLondon/cd14549104cfb3d93d17 to your computer and use it in GitHub Desktop.
Save EricLondon/cd14549104cfb3d93d17 to your computer and use it in GitHub Desktop.
Print Emoji in Ruby
# all emoji
# 1000.times { |i| emoji(127740 + i) + ' ' }
# moon phases
# 8.times { |i| emoji(127761 + i) }
DELAY = 0.3;
# clean screen
def clean
puts "\e[H\e[2J";
end
def emoji(n)
print [n].pack('U*');
end
clean()
64.times do
8.times do |i|
clean
emoji(127768 - i)
puts
sleep DELAY
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment