progress.clj 771 B

1234567891011121314151617181920212223242526272829303132333435
  1. #! bb
  2. (def chars ["\uee06" "\uee07" "\uee08" "\uee09" "\uee0a" "\uee0b"])
  3. (loop [i 0]
  4. (print
  5. (str
  6. ; \u001b \u000d " " ;; ESC CR Moves the cursor to column zero
  7. \u001b "[2J"
  8. \u001b "[H"
  9. ;; normal
  10. "\n Other fonts ["
  11. (str/join
  12. (for [j (range 2 17)]
  13. (if (<= j i) "#" ".")))
  14. "] "
  15. (nth "|/-\\" (mod i 4))
  16. " "
  17. ;; Fira Code
  18. "\n\n Fira Code "
  19. (if (= 0 i) \uee00 \uee03) ;; Progress start
  20. (str/join
  21. (for [j (range 2 17)]
  22. (if (<= j i) \uee04 \uee01)))
  23. (if (= 17 i) \uee05 \uee02)
  24. " "
  25. (nth chars (mod i 6))
  26. " "
  27. #_#_(-> i (/ 17.0) (* 100) (int)) "%"
  28. " "))
  29. (flush)
  30. (Thread/sleep 200)
  31. (recur (mod (inc i) 18)))