Skip to content

Instantly share code, notes, and snippets.

@albemuth
Created July 11, 2011 23:50
Show Gist options
  • Save albemuth/1077074 to your computer and use it in GitHub Desktop.
Save albemuth/1077074 to your computer and use it in GitHub Desktop.
stronglifts5x5.rb
days = ["Mon", "Wed", "Fri"]
exercises = [:squat, :bench_press, :barbell_rows, :overhead_press, :deadlift]
weights = {}
workout_a = [:squat, :bench_press, :barbell_rows]
workout_b = [:squat, :overhead_press, :deadlift]
exercises.each do |e|
weights[e] ||= {:weight => 45, :multiplier => 5}
end
weights[:deadlift] = {:weight => 95, :multiplier => 10}
weights[:barbell_rows] = {:weight => 65, :multiplier => 5}
def side w
return " just the bar" unless w > 45
s = 0.5 * (w - 45)
s = s % 5 == 0 ? "#{s}" : "#{s - (s % 5)} + #{s % 5}"
"#{s} lbs each side"
end
ab = false
12.times do |week|
puts "\n\nweek #{week + 1}"
3.times do |day|
puts " #{days[day]}"
workout = (ab = !ab) ? workout_a : workout_b
workout.each do |e|
sets = e == :deadlift ? 1 : 5
puts " #{sets}x5 #{e.to_s} #{weights[e][:weight]}lbs (#{side weights[e][:weight]})"
weights[e][:weight] += weights[e][:multiplier]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment