Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja-za authored Dec 29, 2024
0 parents commit 54d97a5
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from flask import Flask, render_template, jsonify
import random
import json

app = Flask(__name__)


legs = [
"Goblet squat", "Racked squat", "Squat to press",
"Single arm squat to press (thruster)", "Side lunge",
"Lunge", "Deadlift", "Single arm dead lift"
]

arms = [
"Push-ups", "Pike push-up", "Alternate side press-ups",
"Press-up on kettlebell", "Press-up move kettlebell",
"Press-up lift", "Clean", "Clean and press",
"Single arm press", "Lying press", "Double press",
"Swings", "Bent over row", "Single arm row",
"Around the world", "Turkish get-up"
]

core = [
"Side plank raises", "Plank", "Plank to press-up",
"Sit-ups", "Russian twists", "Twist superman",
"Hip raises", "Leg raises", "Lean on sofa and lift body",
"Abdominal scissors"
]

def ran(num1, num2, num3):
leg_exercise = random.choice(num1)
arm_exercise = random.choice(num2)
core_exercise = random.choice(num3)
return core_exercise, arm_exercise, leg_exercise

@app.route("/", methods=["GET"])
def home():
exercises = ran(legs, arms, core)
return render_template("index.html", exercises=exercises)

@app.route("/create_workout", methods=["GET"])
def create_workout():

core_exercise, arm_exercise, leg_exercise = ran(legs, arms, core)
return jsonify({
'core': core_exercise,
'arm': arm_exercise,
'leg': leg_exercise
})

if __name__ == "__main__":
app.run(debug=True)

0 comments on commit 54d97a5

Please sign in to comment.