-
-
Save mooreniemi/73e1a1fc024fa1fc7c9a to your computer and use it in GitHub Desktop.
Print Emoji in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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