require 'curses'
include Curses
init_screen
win2 = Window.new(3,160,12,10)
win2.setpos(1,1)
6.times do |i|
win2.addstr i.to_s
win2.delch
sleep 0.6
win2.refresh
end #=> 0,1,2,3,4,5,6
和
6.times do |i|
win2.addstr i.to_s
win2.addstr '\b'
sleep 0.6
win2.refresh
end #=> 0\n,1\n,2\n,3\n,4\n,5\n,6\n
我想打印一个 0,0 消失,然后是 1,然后让 1 消失,然后是 2,然后让 2 消失,一直到 6