Skip to content

Instantly share code, notes, and snippets.

@epitron
Created June 23, 2015 07:05
Show Gist options
  • Save epitron/d976d5eeea38c7036d32 to your computer and use it in GitHub Desktop.
Save epitron/d976d5eeea38c7036d32 to your computer and use it in GitHub Desktop.
require 'io/console'
height, width = $stdin.winsize
print "\e[2J"
t = 30
loop {
t += 1
print "\e[H"
(1..height-2).each { |n|
zoom = t
a = [" "] * zoom
dist = zoom/n.to_f
(1...n).each { |i| a[i*dist] = "|" }
puts "#{n.to_s.rjust(3)} #{a.join('')}"[0..width-4]
}
sleep 0.01
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment