Skip to content

Instantly share code, notes, and snippets.

@vy-let
Created July 29, 2015 00:40
Show Gist options
  • Save vy-let/65b1fd47c3950e2bea6a to your computer and use it in GitHub Desktop.
Save vy-let/65b1fd47c3950e2bea6a to your computer and use it in GitHub Desktop.
Print a clockwise-spinning pinwheel on an ANSI-compliant terminal.
#!/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
@vy-let
Copy link
Author

vy-let commented Jul 29, 2015

Use ^c to exit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment