Created
July 29, 2015 00:40
-
-
Save vy-let/65b1fd47c3950e2bea6a to your computer and use it in GitHub Desktop.
Print a clockwise-spinning pinwheel on an ANSI-compliant terminal.
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
#!/usr/bin/env ruby | |
begin | |
loop do | |
%w( ◐ ◓ ◑ ◒ ).each do |pchar| | |
print "\x1b[1G\x1b[0K#{pchar} " | |
sleep 0.1 | |
end | |
end | |
rescue Exception | |
# goodbye | |
print "\x1b[1G" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
^c
to exit.