;;模擬console原位更新輸出
;;空格擦除法,輸出空格,是爲了擦除短字符串尾部沒有佔用的位置,因爲退格只是回退,並不刪除
(dotimes [_ 10](let [n (rand) sn (.substring (str n ) 2) len (count sn)](print sn)(flush)(Thread/sleep 500) (dotimes[_ len](print "\b"))(flush)))
;;回退鍵配合刪除字符,由於刪除後,光標又前進一位,所以需要再次回退
(dotimes [_ 10](let [n (rand) sn (.substring (str n ) 2) len (count sn)](print sn)(flush)(Thread/sleep 500) (dotimes[t len](print "\b\u007f\b"))(flush)))