From de2c9d7eab9be16b22983a3e027773b9ff559bbc Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 14 Oct 2022 16:59:22 -0400 Subject: (fix) use rounded targetreps for rep goals --- repgoal.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'repgoal.hs') 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 let best = bestPerformance stats targetReps = case week of 1 -> 5; 2 -> 3; 3 -> 1; _ -> undefined :: Int targetPercentage = case week of 1 -> 85; 2 -> 90; 3 -> 95; _ -> undefined - targetWeight = (* (targetPercentage % 100)) $ (* (90 % 100)) $ computeOneRepMax best - repGoal = computeRepGoal targetWeight stats - goalTo1RM g = computeOneRepMax $ Achieved g targetWeight - showGoal g = printf "%d @ %s ≈ 1 @ %s" g (showRational targetWeight) (showRational (goalTo1RM g)) + computedTarget = (* (targetPercentage % 100)) $ (* (90 % 100)) $ computeOneRepMax best + targetWeight = ceilingN 5 computedTarget + repGoal = computeRepGoal (targetWeight % 1) stats + goalTo1RM g = computeOneRepMax $ Achieved g (targetWeight % 1) + showGoal g = printf "%2d @ %d ≈ 1 @ %s" g targetWeight (showRational (goalTo1RM g)) in map (padLeftRight 2) [ txt $ (if week == 1 then liftName else " "), str $ show week, - str $ printf "%d @ %d" targetReps (ceilingN 5 targetWeight), - -- str $ showRational $ (* (percentage week)) $ (* (90 % 100)) $ computeOneRepMax best, + str $ printf "%2d @ %d" targetReps targetWeight, str $ showGoal repGoal, str $ showGoal (repGoal + 1) ] -- cgit v1.2.3