Skip to content

Instantly share code, notes, and snippets.

@maxjacobson
Created May 16, 2016 22:33
Show Gist options
  • Save maxjacobson/fe40c331b4046e348376bf565ca6eee3 to your computer and use it in GitHub Desktop.
Save maxjacobson/fe40c331b4046e348376bf565ca6eee3 to your computer and use it in GitHub Desktop.
trap('INT') do
print("\n")
exit
end
output = Enumerator.new do |yielder|
chars = "▁▂▃▄▅▆█".split("")
chars = chars + chars.reverse
nums = (0..(chars.length - 1)).to_a
loop do
char = chars.fetch(nums.first)
yielder << char
nums.rotate!
end
end
loop do
print output.next
sleep 0.1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment