summaryrefslogtreecommitdiff
path: root/repgoal.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-10-14 16:59:22 -0400
committerAndrew Cady <d@jerkface.net>2022-10-14 16:59:22 -0400
commitde2c9d7eab9be16b22983a3e027773b9ff559bbc (patch)
treebc5ed403139e2449e0b833cfa0a7b1297a3982b2 /repgoal.hs
parent3631e79b5ad9ebbc72aef5a52ec1e2047af4798e (diff)
(fix) use rounded targetreps for rep goals
Diffstat (limited to 'repgoal.hs')
-rwxr-xr-xrepgoal.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/repgoal.hs b/repgoal.hs
index 5533098..2aeceb6 100755
--- a/repgoal.hs
+++ b/repgoal.hs
@@ -120,17 +120,17 @@ drawUI (St lifts) = [vCenter $ vBox [hCenter oneRepMaxTable, hCenter lastSetTabl
120 let best = bestPerformance stats 120 let best = bestPerformance stats
121 targetReps = case week of 1 -> 5; 2 -> 3; 3 -> 1; _ -> undefined :: Int 121 targetReps = case week of 1 -> 5; 2 -> 3; 3 -> 1; _ -> undefined :: Int
122 targetPercentage = case week of 1 -> 85; 2 -> 90; 3 -> 95; _ -> undefined 122 targetPercentage = case week of 1 -> 85; 2 -> 90; 3 -> 95; _ -> undefined
123 targetWeight = (* (targetPercentage % 100)) $ (* (90 % 100)) $ computeOneRepMax best 123 computedTarget = (* (targetPercentage % 100)) $ (* (90 % 100)) $ computeOneRepMax best
124 repGoal = computeRepGoal targetWeight stats 124 targetWeight = ceilingN 5 computedTarget
125 goalTo1RM g = computeOneRepMax $ Achieved g targetWeight 125 repGoal = computeRepGoal (targetWeight % 1) stats
126 showGoal g = printf "%d @ %s ≈ 1 @ %s" g (showRational targetWeight) (showRational (goalTo1RM g)) 126 goalTo1RM g = computeOneRepMax $ Achieved g (targetWeight % 1)
127 showGoal g = printf "%2d @ %d ≈ 1 @ %s" g targetWeight (showRational (goalTo1RM g))
127 in 128 in
128 map (padLeftRight 2) 129 map (padLeftRight 2)
129 [ 130 [
130 txt $ (if week == 1 then liftName else " "), 131 txt $ (if week == 1 then liftName else " "),
131 str $ show week, 132 str $ show week,
132 str $ printf "%d @ %d" targetReps (ceilingN 5 targetWeight), 133 str $ printf "%2d @ %d" targetReps targetWeight,
133 -- str $ showRational $ (* (percentage week)) $ (* (90 % 100)) $ computeOneRepMax best,
134 str $ showGoal repGoal, 134 str $ showGoal repGoal,
135 str $ showGoal (repGoal + 1) 135 str $ showGoal (repGoal + 1)
136 ] 136 ]