summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2022-10-03 23:46:23 -0400
committerAndrew Cady <d@jerkface.net>2022-10-03 23:46:23 -0400
commit5f71638722aeb5eb2860fc3019dcd80414ea3cb1 (patch)
tree4fafe52989b503479e54c09e36b25d8bc5290683
parent5857d01a6badd38f9a216d090b047474b19569c3 (diff)
add goal+1; change table format
-rwxr-xr-xrepgoal.hs9
1 files 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 ()]
101drawUI () = [a] 101drawUI () = [a]
102 where 102 where
103 a = hCenter $ renderTable $ table $ 103 a = hCenter $ renderTable $ table $
104 [str "Exercise", str "Achieved Reps", str "Computed 1RM", str "Weight", str "Goal Reps", str "Goal 1RM"] : map toRow exercises 104 map str ["Exercise", "Achieved Reps", "Computed 1RM", "Goal Reps", "Goal+1"] : map toRow exercises
105 toRow x@ExerciseTarget{..} = 105 toRow x@ExerciseTarget{..} =
106 let ExerciseStats{..} = stats 106 let ExerciseStats{..} = stats
107 repGoal = computeRepGoal x 107 repGoal = computeRepGoal x
108 oneRepMaxGoal = computeOneRepMax $ ExerciseStats exerciseName repGoal targetWeight 108 goalTo1RM g = computeOneRepMax $ ExerciseStats exerciseName g targetWeight
109 in 109 in
110 [ 110 [
111 txt exerciseName, 111 txt exerciseName,
112 str $ printf "%d @ %s" achievedReps (showRational achievedWeight), 112 str $ printf "%d @ %s" achievedReps (showRational achievedWeight),
113 str $ showRational $ computeOneRepMax stats, 113 str $ showRational $ computeOneRepMax stats,
114 str $ showRational targetWeight, 114 str $ printf "%d @ %s ≈ 1 @ %s" (repGoal) (showRational targetWeight) (showRational (goalTo1RM repGoal)),
115 str $ show repGoal, 115 str $ printf "%d @ %s ≈ 1 @ %s" (repGoal + 1) (showRational targetWeight) (showRational (goalTo1RM $ repGoal + 1))
116 str $ showRational oneRepMaxGoal
117 ] 116 ]
118 where 117 where
119 118