Last active
August 29, 2015 14:10
-
-
Save edwardloveall/57f332f03fe10fe18c3d to your computer and use it in GitHub Desktop.
Having some fun with stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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