diff options
author | Andrew Cady <d@jerkface.net> | 2022-11-03 12:05:26 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2022-11-03 12:05:37 -0400 |
commit | dc5a8f2b008d20491b81108a3eccd24e23f379ac (patch) | |
tree | 6382fda7d2a1c9ee6816924881bb7456607aa8d9 | |
parent | 51610f0f9babbbbef2e6adfee85940c4a52e81b9 (diff) |
factor
-rwxr-xr-x | repgoal.hs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -191,16 +191,16 @@ drawUI st = [vCenter $ vBox [hCenter $ hBox [header, oneRepMaxTable], withVScrol | |||
191 | repGoal = computeRepGoal targetWeight stats | 191 | repGoal = computeRepGoal targetWeight stats |
192 | goalTo1RM g = computeOneRepMax $ Achieved g targetWeight | 192 | goalTo1RM g = computeOneRepMax $ Achieved g targetWeight |
193 | showGoal g = printf "%2d @ %d ≈ 1 @ %s" g targetWeight (showRational (goalTo1RM g)) | 193 | showGoal g = printf "%2d @ %d ≈ 1 @ %s" g targetWeight (showRational (goalTo1RM g)) |
194 | pad = padBottom (Pad $ if amrap then 1 else 0) | ||
194 | in | 195 | in |
195 | map (padLeftRight 2) | 196 | map (padLeftRight 2) |
196 | [ | 197 | [ |
197 | -- txt $ if position == FirstInList then liftName else " ", | 198 | pad $ txt $ case position of FirstInList -> liftRecordName; NotFirstInList -> " ", |
198 | txt $ case position of FirstInList -> liftName; NotFirstInList -> if amrap then " \n " else " ", | 199 | pad $ str $ printf "%2d%s @ %d" targetReps (if amrap then "+" else "" :: Text) targetWeight, |
199 | str $ printf "%2d%s @ %d%s" targetReps (if amrap then "+" else "" :: Text) targetWeight (if amrap then "\n " else "" :: String), | 200 | pad $ str $ showPlates targetWeight, |
200 | str $ showPlates targetWeight ++ if amrap then "\n " else "", | ||
201 | str $ if amrap then showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) else " ", | 201 | str $ if amrap then showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) else " ", |
202 | txt $ if amrap then " \n " else " ", | 202 | pad $ txt " ", |
203 | txt $ if amrap then " \n " else " " | 203 | pad $ txt " " |
204 | ] | 204 | ] |
205 | 205 | ||
206 | showPlates :: Integer -> String | 206 | showPlates :: Integer -> String |