From 25464a4e0c9c2d0db16e3bc238e8b98e1a2ed15a Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 17 Aug 2022 01:32:54 +0000 Subject: [PATCH] extra tally symbol --- .../source/HabitState.kiss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss index ee4e0a44..63468f21 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss @@ -606,6 +606,10 @@ (+= y b.height)))) (function pointsStr [points] - (let [tallyUnit 5] - (+ (* "*" (Math.floor (/ points tallyUnit))) - (* "+" (% points tallyUnit))))) \ No newline at end of file + (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)) \ No newline at end of file