I want to create a fake percent counter within terminal in Ruby somewhat like this:
percent = 0
(1..100).each{|x| sleep(0.05); print "#{percent+=1}%"}
How do I make it so that instead of printing percent over and over again it just increasing the value of percent by 1 but stays "in place".
Please note that this is for aesthetic purposes only.
Thanks