Skip to content

Instantly share code, notes, and snippets.

@everm1nd
Last active May 20, 2022 11:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save everm1nd/9971598 to your computer and use it in GitHub Desktop.
Save everm1nd/9971598 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