Created
April 8, 2013 18:13
-
-
Save ddrscott/5339084 to your computer and use it in GitHub Desktop.
Rotating phases of the moon using Emoji.
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
# -*- coding: utf-8 -*- | |
# phases = %w{π π π π π π π π} | |
phases = (0x1F311..0x1F318).to_a.collect{|c| [c].pack('U*')} | |
clear_line = "\r\e[0K" | |
1000.times do |i| | |
phase = phases[i % phases.size] | |
print "#{clear_line} #{phase}\t#{i} #{phase.unpack('U*').map{ |i| "\\u" + i.to_s(16).rjust(4, '0') }.join}" | |
sleep rand / 10.0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is really cool!