From 5f71638722aeb5eb2860fc3019dcd80414ea3cb1 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 3 Oct 2022 23:46:23 -0400 Subject: add goal+1; change table format --- repgoal.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/repgoal.hs b/repgoal.hs index b9c6df3..afac135 100755 --- a/repgoal.hs +++ b/repgoal.hs @@ -101,19 +101,18 @@ drawUI :: () -> [Widget ()] drawUI () = [a] where a = hCenter $ renderTable $ table $ - [str "Exercise", str "Achieved Reps", str "Computed 1RM", str "Weight", str "Goal Reps", str "Goal 1RM"] : map toRow exercises + map str ["Exercise", "Achieved Reps", "Computed 1RM", "Goal Reps", "Goal+1"] : map toRow exercises toRow x@ExerciseTarget{..} = let ExerciseStats{..} = stats repGoal = computeRepGoal x - oneRepMaxGoal = computeOneRepMax $ ExerciseStats exerciseName repGoal targetWeight + goalTo1RM g = computeOneRepMax $ ExerciseStats exerciseName g targetWeight in [ txt exerciseName, str $ printf "%d @ %s" achievedReps (showRational achievedWeight), str $ showRational $ computeOneRepMax stats, - str $ showRational targetWeight, - str $ show repGoal, - str $ showRational oneRepMaxGoal + str $ printf "%d @ %s ≈ 1 @ %s" (repGoal) (showRational targetWeight) (showRational (goalTo1RM repGoal)), + str $ printf "%d @ %s ≈ 1 @ %s" (repGoal + 1) (showRational targetWeight) (showRational (goalTo1RM $ repGoal + 1)) ] where -- cgit v1.2.3