Skip to content

Instantly share code, notes, and snippets.

@zotherstupidguy
Forked from vy-let/terminal-pinwheel.rb
Last active September 28, 2015 08:35
Show Gist options
  • Save zotherstupidguy/bcad8f7d820735237d41 to your computer and use it in GitHub Desktop.
Save zotherstupidguy/bcad8f7d820735237d41 to your computer and use it in GitHub Desktop.
Print a clockwise-spinning pinwheel on an ANSI-compliant terminal.
#!/usr/bin/env ruby
#TODO add some colors to the circle
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