Skip to content

Instantly share code, notes, and snippets.

@mooreniemi
Forked from everm1nd/emoji.rb
Created October 2, 2015 14:53
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 mooreniemi/73e1a1fc024fa1fc7c9a to your computer and use it in GitHub Desktop.
Save mooreniemi/73e1a1fc024fa1fc7c9a 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