Skip to content

Instantly share code, notes, and snippets.

@edwardloveall
Last active August 29, 2015 14:10
Show Gist options
  • Save edwardloveall/57f332f03fe10fe18c3d to your computer and use it in GitHub Desktop.
Save edwardloveall/57f332f03fe10fe18c3d to your computer and use it in GitHub Desktop.
Having some fun with stdout
class String
def rotate(n = 1)
chars.rotate(n).join
end
def rotate!(n = 1)
replace(rotate(n))
end
end
line = '`·.¸¸.·´¯' * 10
1.upto(100) do
line.rotate!
$stdout.print(line + "\r")
sleep(0.05)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment