extra tally symbol

This commit is contained in:
2022-08-17 01:32:54 +00:00
parent 4546792a17
commit 25464a4e0c

View File

@@ -606,6 +606,10 @@
(+= y b.height))))
(function pointsStr [points]
(let [tallyUnit 5]
(+ (* "*" (Math.floor (/ points tallyUnit)))
(* "+" (% points tallyUnit)))))
(let [&mut str "" tallyUnit 5 symbols ["+" "*" "\$"]]
(doFor i (reverse (collect (range symbols.length)))
(let [scaledTallyUnit (^ tallyUnit i)
tallies (Math.floor (/ points scaledTallyUnit))]
(+= str (* (nth symbols i) tallies))
(-= points (* tallies scaledTallyUnit))))
str))