[email protected] wrote:
but I don’t want a linebreak after the counter is displayed. I want it
just to keep refreshing itself, basically. Am I missing something
with puts or print or p? Any ideas?
$stdout.sync = true
20.times do |_counter|
counter = _counter.to_s
print counter + “\b” * counter.size
FYI: puts and p both add “\n” to the output if it is not yet there.