Display progress bars.

This commit is contained in:
Dominik Pantůček 2023-03-30 21:17:46 +02:00
parent ca1270d7ae
commit 99fac43aa4

View file

@ -116,9 +116,17 @@
(* raw-value
(- (cdr range) (car range)))))
(value% (* 100 value))
(ivalue% (inexact->exact (round value%))))
(ivalue% (inexact->exact (round value%)))
(bwidth (inexact->exact
(round
(* value (*progress%-width*)))))
(swidth (- (*progress%-width*) bwidth)))
(display
(sprintf "\r[]~A% ~A" ivalue% (*current-progress%*))))))
(sprintf "\r[~A~A]~A% ~A"
(make-string bwidth #\=)
(make-string swidth #\space)
ivalue%
(*current-progress%*))))))
;; If the new value is different-enough from the current one, updates
;; it and re-prints the progress%