Skip to content

Commit e9f9cd3

Browse files
committed
Added progress to showcases
1 parent e7d9385 commit e9f9cd3

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
Mozilla Foundation (https://www.mozilla.org/en-US/contact/)
99
Telefonica S.A.
10-
Nikita Prokopov ([email protected]) github.com/tonsky
10+
Nikita Prokopov ([email protected]) github.com/tonsky

extras/showcases.txt

+12-11
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,18 @@ _| |_ _||_ __| ___| |__ |___
307307

308308
# Progress bars
309309

310-
[>----------]
311-
[=>---------]
312-
[==>--------]
313-
[===>-------]
314-
[====>------]
315-
[=====>-----]
316-
[======>----]
317-
[=======>---]
318-
[========>--]
319-
[=========>-]
320-
[==========>]
310+
[...........] [-----------] 
311+
[#..........] [>----------] 
312+
[##.........] [=>---------] 
313+
[###........] [==>--------] 
314+
[####.......] [===>-------] 
315+
[#####......] [====>------] 
316+
[######.....] [=====>-----] 
317+
[#######....] [======>----] 
318+
[########...] [=======>---] 
319+
[#########..] [========>--] 
320+
[##########.] [=========>-] 
321+
[###########] [==========>] 
321322

322323
# Sanity check
323324

script/progress.clj

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#! bb
2+
3+
(def chars ["\uee06" "\uee07" "\uee08" "\uee09" "\uee0a" "\uee0b"])
4+
5+
(loop [i 0]
6+
(print
7+
(str
8+
\u001b \u000d ;; ESC CR Moves the cursor to column zero
9+
(if (= 0 i) \uee00 \uee03) ;; Progress start
10+
(str/join
11+
(for [j (range 2 17)]
12+
(if (<= j i) \uee04 \uee01)))
13+
(if (= 17 i) \uee05 \uee02)
14+
" "
15+
(nth chars (mod i 6))
16+
" "
17+
(-> i (/ 17.0) (* 100) (int)) "% "))
18+
(flush)
19+
(Thread/sleep 200)
20+
(recur (mod (inc i) 18)))

0 commit comments

Comments
 (0)