aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-12-25 11:01:02 +0000
committerrodri <rgl@antares-labs.eu>2020-12-25 11:01:02 +0000
commit414b63b4a1d2359de630cada38233c74dfe868f1 (patch)
treed5603fe05bc79c7cd43aeb43e085e04593aa402b
downloadrcfitness-414b63b4a1d2359de630cada38233c74dfe868f1.tar.gz
rcfitness-414b63b4a1d2359de630cada38233c74dfe868f1.tar.bz2
rcfitness-414b63b4a1d2359de630cada38233c74dfe868f1.zip
initial release.
-rw-r--r--21dec202013
-rw-r--r--bmr3
-rw-r--r--exercises39
-rw-r--r--readme.md3
-rwxr-xr-xworkout107
5 files changed, 165 insertions, 0 deletions
diff --git a/21dec2020 b/21dec2020
new file mode 100644
index 0000000..8d68ea9
--- /dev/null
+++ b/21dec2020
@@ -0,0 +1,13 @@
+#exercise,reps,sets
+biceps,10,5
+shoulders,10,5
+back,10,5
+forearms,50,5
+crunch abs,15,4
+leg abs (reverse crunch),15,2
+corkskrew abs,15,0
+rocky abs (dragon flag),15,1
+russian abs,15,2
+push-ups,10,6
+glutes,20,2
+calves,50,1
diff --git a/bmr b/bmr
new file mode 100644
index 0000000..30ff882
--- /dev/null
+++ b/bmr
@@ -0,0 +1,3 @@
+# 66 + 6.23*lbs + 12.7*inch + 6.8*years
+66 + 6.23*176.36 + 12.7*68.89 - 6.8*23
+1883.2258
diff --git a/exercises b/exercises
new file mode 100644
index 0000000..d1857f5
--- /dev/null
+++ b/exercises
@@ -0,0 +1,39 @@
+biceps
+ dumbbell lifts with your hands facing upward.
+shoulders
+ dumbbell wing lifts.
+back
+ dumbbell wing lifts with your hands facing up (thumbs out) and
+ your back leaned to the front, slightly bending your knees
+ forward.
+forearms
+ single dumbbell lift with your arms stretched forward.
+crunch abs
+ classical ab workout. put your hands either over the pecs or
+ besides your head.
+leg abs (reverse crunch)
+ legs straight without touching the floor, then crunch them up
+ until your knees almost touch your pecs.
+corkskrew abs
+ sit with your legs above the ground and your hands on the
+ floor by the side, then pull your knees in to one side, then
+ push out, then the other side.
+rocky abs (dragon flag)
+ based on the workout rocky does in Rocky IV. legs straight
+ without touching the floor, core tight, then bring them all
+ the way up along with the core until the only part of your
+ body on the ground are your shoulders and hands.
+russian abs
+ sit with your legs straight above the ground, then twist your
+ core trying to touch the floor on each side. you can also
+ bend your knees a bit.
+push-ups
+ classical ones (hands besides the pecs or above) focused on
+ arms and pecs (by placing your hands further away or closer).
+glutes
+ stand up, then raise one leg straight up to the back, then the
+ other, while keeping your back straight and facing forward.
+calves
+ while holding a couple of dumbbells, bend your knees slightly
+ forward and begin raising your toes from the ground, standing
+ on the tips, then back down.
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..770323e
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,3 @@
+# rcfitness
+
+Rc tools for fitness tracking
diff --git a/workout b/workout
new file mode 100755
index 0000000..13ffae4
--- /dev/null
+++ b/workout
@@ -0,0 +1,107 @@
+#!/bin/rc
+rfork en
+
+exercises=()
+session=()
+reps=()
+sets=()
+wdir=$home/lib/fitness
+today=`{date | awk '{print $3 tolower($2) $6}'}
+
+. <{<$wdir/exercises awk '/^[^ ]/ {print "exercises=($exercises ''"$0"'')"}'}
+
+fn isnumber{
+ ! ~ `{echo $1 | awk '/^[0-9]+$/'} ''
+}
+
+fn printexers{
+ for(i in `{seq 1 $#exercises})
+ echo $i':' $exercises($i)
+}
+
+fn printsession{
+ showreps=$1
+ showsets=$2
+ for(i in `{seq 1 $#session}){
+ echo -n $i':' $exercises($session($i))
+ if(~ $showreps 1 && ! ~ $#reps 0){
+ echo -n ' '[$reps($i)^x
+ if(~ $showsets 1 && ! ~ $#sets 0)
+ echo -n $sets($i)
+ echo -n ]
+ }
+ echo
+ }
+}
+
+fn plansession{
+ session=()
+ e=()
+ while(! ~ $e w){
+ echo program your workout session (a to add all, w to begin):
+ printexers | mc
+ e=`{read}
+ if(isnumber $e && test $e -ge 1 && test $e -le $#exercises)
+ session=($session $e)
+ if not if(~ $e a){
+ session=`{seq 1 $#exercises}
+ e=w
+ }
+ }
+
+ printsession | mc
+ echo -n is this all right?' '
+ ready=`{read}
+
+ if(~ $ready y)
+ setupreps
+ if not
+ plansession
+}
+
+fn setupreps{
+ reps=()
+ for(i in `{seq 1 $#session}){
+ r=()
+ while(! isnumber $r){
+ echo -n how many reps for $exercises($session($i))?' '
+ r=`{read}
+ }
+ reps=($reps $r)
+ }
+
+ printsession 1 | mc
+ echo -n is this all right?' '
+ ready=`{read}
+
+ if(~ $ready y)
+ start
+ if not
+ setupreps
+}
+
+fn mkreport{
+ echo '#'exercise,reps,sets >$wdir/$today
+ for(i in `{seq 1 $#session})
+ echo $exercises($session($i))^,^$reps($i)^,^$sets($i) >>$wdir/$today
+}
+
+fn start{
+ # initialize the set array
+ for(i in `{seq 1 $#session})
+ sets=($sets 0)
+
+ while(! ~ $e q){
+ printsession 1 1 | mc
+ e=`{read}
+ if(isnumber $e && test $e -ge 1 && test $e -le $#session){
+ lo=`{echo $e-1 | bc}
+ hi=`{echo $e+1 | bc}
+ sets=($sets(1-$lo) `{echo $sets($e)+1 | bc} $sets($hi-))
+ }
+ }
+
+ mkreport
+}
+
+plansession