Skip to content

Instantly share code, notes, and snippets.

@sshopov
Created July 1, 2024 07:34
Show Gist options
  • Save sshopov/cacc73413dc1374c26ca91e8432a2415 to your computer and use it in GitHub Desktop.
Save sshopov/cacc73413dc1374c26ca91e8432a2415 to your computer and use it in GitHub Desktop.
Pavel Tsatsouline's The Quick and the Dead book converted into a Python script. Adjust the weights and the weight functions.
'''import
#swing pushup
series_lookup = dict(1=2,2=3,3=3,4=4,5=4,6=5)
rep_set_lookup = dict(1='5/4',2='5/4',3=['5/4','10/2'],4=['5/4','10/2'],5='10/2',6='10/2')
swing_type_lookup = dict(1=2,2=2,3=2,4=1,5=1,6=1)
pushup_type_lookup = dict(1=2,2=2,3=2,4=1,5=1,6=1) #palms fists
# snatches
series_lookup same
rep set same
train_lookup = dict(1=1,2=1,3=1,4=0,5=0,6=0) #sat or sun off
# combined
exercise_lookup = dict(1=1,2=1,3=1,4=0,5=0,6=0) 1=swing&push 0=snatches
weight_lookup = dict(1=x-20,2=x+20,3=x+20,4=x,5=x,6=x)
or 10x10
every 1.5 min 10L 10P 10R 10P 3-5 per week
same hand per set
start with non-dominant hand
off day = 2 series at 5/4
TODO:
schedule in testing e.g. 5min snatches every 2-4 weeks
program deadlifts chinups presses???
'''
from datetime import datetime, timedelta
import random
def roll_die():
return random.randint(1,6)
#train_lookup = {1:1,2:1,3:1,4:0,5:0,6:0} #sat or sun off
series_lookup = {1:2,2:3,3:3,4:4,5:4,6:5}
series_choice = [2, 3, 3, 4, 4, 5]
yes_or_no = [0, 1, 1]
yes_or_no = [0, 1, 0, 1, 1]
#training_days_per_week = [0, 1, 0, 1, 1]
weight_lookup = {1:16,2:32,3:32,4:24,5:24,6:24}
snatch_weights = [16, 32, 32, 24, 24, 24]
two_handed_swing_weights = [32, 48, 48, 40, 40, 40]
one_handed_swing_weights = [24, 40, 40, 32, 32, 32]
now = datetime.now()
random.seed()
#random.choice(one_hande_swing_weights)
#instead of weight = weight_lookup[roll_die()]
num_of_weeks = 6
schedule = []
for i in range(7*num_of_weeks):
date = (now + timedelta(days=i)).strftime('%a %D')
if random.choice(yes_or_no): #train or rest
if roll_die() in (1,2,3):
if roll_die() in (1,2,3):
exercise = 'two handed swings and push ups'
weight = random.choice(two_handed_swing_weights)
else:
exercise = 'one handed swings and push ups'
weight = random.choice(one_handed_swing_weights)
rest = 3
else:
exercise = 'snatches'
weight = random.choice(snatch_weights)
rest = 4
reps_sets = random.choice(['5 reps every 30 sec for 4 sets', '10 reps every minute for 2 sets'])
series = random.choice(series_choice)
instruction = "{}: {}, {} series - 1 every {} minutes, {} with {} kg".format(date, exercise, series, rest, reps_sets, weight)
schedule.append(instruction)
else:
schedule.append('{}: rest'.format(date))
for i,j in enumerate(schedule):
print(i+1, j)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment