aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2021-06-30 19:30:06 +0000
committerrodri <rgl@antares-labs.eu>2021-06-30 19:30:06 +0000
commit3f2f92a1f48783f10692ae2defaf57585805b704 (patch)
tree59bd4e6e021ac032047b6e0ad37b813b6f5ce3ba
parent3d91cb5bef0305ac05d3a172aecb0d60a5a2c500 (diff)
downloadrcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.tar.gz
rcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.tar.bz2
rcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.zip
workout: ignore shell-style comments from input when adding reps per exercise.
default.session: updated program. exercises: some corrections and new stuff. added new scripts to register age, height, Δweight/dt, BSA and SBSI (the latter too technical to be useful for me but were fun rc practice.)
-rwxr-xr-xage8
-rwxr-xr-xbsa25
-rw-r--r--default.session55
-rw-r--r--exercises36
-rw-r--r--height1
-rwxr-xr-xlsexers2
-rwxr-xr-xsbsi33
-rwxr-xr-xworkout5
8 files changed, 143 insertions, 22 deletions
diff --git a/age b/age
new file mode 100755
index 0000000..8be91b8
--- /dev/null
+++ b/age
@@ -0,0 +1,8 @@
+#!/bin/rc
+rfork ne
+bday=862048830 # % date -j -f "%b %d %Y" "Apr 26 1997" +%s
+today=`{date -n}
+
+bc <<EOF
+($today - $bday)/(3600*24*365)
+EOF
diff --git a/bsa b/bsa
new file mode 100755
index 0000000..021131b
--- /dev/null
+++ b/bsa
@@ -0,0 +1,25 @@
+#!/bin/rc
+#
+# Body Surface Area (BSA) following the Lipscombe equation
+# BSA(m²) = 0.00878108 * W(kg)^0.434972 * H(cm)^0.67844
+#
+rfork ne
+w=()
+h=()
+flagfmt=''
+args='weight height'
+
+fn usage {
+ aux/usage
+ exit usage
+}
+
+if(! ifs=() eval `{aux/getflags $*} || ! ~ $#* 2)
+ usage
+
+w=$1
+h=$2
+
+hoc <<EOF
+0.00878108 * $w ^ 0.434972 * $h ^ 0.67844
+EOF
diff --git a/default.session b/default.session
index ff94c4e..5000cda 100644
--- a/default.session
+++ b/default.session
@@ -1,23 +1,38 @@
a
y
-15
-15
-15
-30
-20
-25
-15
-10
-20
-15
-20
-50
-30
-20
-10
-10
-10
-10
-10
-10
+20 # bicep curls
+15 # lateral raises
+15 # back
+40 # forearms
+30 # sit-up abs
+30 # leg abs (reverse crunch)
+20 # corkskrew abs
+10 # rocky abs (dragon flag)
+20 # russian abs
+20 # push-ups
+20 # glutes
+50 # calf raises
+30 # floor dumbbell press
+20 # flutter kicks
+25 # squats
+10 # weighted squats
+10 # pull-ups with grounded heels
+10 # parallel bar chest dips
+10 # single bar chest dips
+10 # parallel bar pull-ups with grounded heels
+20 # hammer curls
+1 # bear walk
+10 # supermans
+15 # push-ups with elevated feet
+10 # wide push-ups
+10 # diamond push-ups
+3 # archer push-ups
+1 # plank
+1 # plank up and down
+1 # high to low plank
+1 # side plank
+10 # side plank raises
+15 # pull-ups with elevated feet
+10 # chin-ups with elevated feet
+10 # parallel bar leg raises
y
diff --git a/exercises b/exercises
index adeed2a..2813c2b 100644
--- a/exercises
+++ b/exercises
@@ -8,7 +8,7 @@ back
forward.
forearms
single dumbbell lift with your arms stretched forward.
-crunch abs
+sit-up abs
classical ab workout. put your hands either over the pecs or
besides your head.
leg abs (reverse crunch)
@@ -33,7 +33,7 @@ push-ups
glutes
stand up, then raise one leg straight up to the back, then the
other, while keeping your back straight and facing forward.
-calves
+calf raises
while holding a couple of dumbbells, bend your knees slightly
forward and begin raising your heels from the ground, standing
on the tips, then back down.
@@ -55,3 +55,35 @@ single bar chest dips
TBD
parallel bar pull-ups with grounded heels
TBD
+hammer curls
+ TBD
+bear walk
+ quadrupedal walking.
+supermans
+ lay down on the floor, face down, and stretch your arms and
+ legs in the opposite sense, then lift them up trying to touch
+ the ceiling. hold it for a while and rest, then repeat.
+push-ups with elevated feet
+ classical push-ups with your feet over a high surface.
+wide push-ups
+ classical push-ups with your hands wide apart.
+diamond push-ups
+ classical push-ups with your hands closer together.
+archer push-ups
+ TBD
+plank
+ TBD
+plank up and down
+ TBD
+high to low plank
+ TBD
+side plank
+ TBD
+side plank raises
+ TBD
+pull-ups with elevated feet
+ TBD
+chin-ups with elevated feet
+ TBD
+parallel bar leg raises
+ TBD
diff --git a/height b/height
new file mode 100644
index 0000000..f07e286
--- /dev/null
+++ b/height
@@ -0,0 +1 @@
+175
diff --git a/lsexers b/lsexers
new file mode 100755
index 0000000..becd892
--- /dev/null
+++ b/lsexers
@@ -0,0 +1,2 @@
+#!/bin/rc
+<exercises grep -v '^ ' | awk '{print NR" "$0}'
diff --git a/sbsi b/sbsi
new file mode 100755
index 0000000..beb4c58
--- /dev/null
+++ b/sbsi
@@ -0,0 +1,33 @@
+#!/bin/rc
+#
+# Surface-based Body Shape Index (SBSI)
+# H(cm)^7/4 * WC(cm)^5/6
+# SBSI = ------------------------
+# BSA(m²) * VTC(cm)
+# where WC is waist circumference and VTC is the vertical trunk one.
+#
+rfork ne
+vtc=()
+wc=()
+w=()
+h=()
+flagfmt=''
+args='vtc wc weight height'
+
+fn usage {
+ aux/usage
+ exit usage
+}
+
+if(! ifs=() eval `{aux/getflags $*} || ! ~ $#* 4)
+ usage
+
+vtc=$1
+wc=$2
+w=$3
+h=$4
+bsa=`{bsa $w $h}
+
+hoc <<EOF
+($h ^ (7/4) * $wc ^ (5/6))/($bsa * $vtc)
+EOF
diff --git a/workout b/workout
index 78a2bee..d574c49 100755
--- a/workout
+++ b/workout
@@ -15,6 +15,10 @@ fn isnumber{
! ~ `{echo $1 | awk '/^[0-9]+$/'} ''
}
+fn sanitize{
+ echo $1 | sed 's/[ ]#.*//g'
+}
+
fn printexers{
for(i in `{seq 1 $#exercises})
echo $i':' $exercises($i)
@@ -67,6 +71,7 @@ fn setupreps{
while(! isnumber $r){
echo -n how many reps for $exercises($session($i))?' '
r=`{read}
+ r=`{sanitize $r}
}
reps=($reps $r)
}