diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-11 19:23:01 +0200 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2024-10-11 19:23:01 +0200 |
| commit | f80463a6437533deef1d85ffa31cf0cc5ed8e454 (patch) | |
| tree | 492b1497cf648e08e84a35dea2d217a57643dab0 /app.py | |
| parent | 20d668454a1e1d8f17f7e5d4d25f667f62381cd1 (diff) | |
Added skilled and random games
Diffstat (limited to 'app.py')
| -rw-r--r-- | app.py | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -22,10 +22,20 @@ def home(): return render_template("index.j2") -@app.route("/new-games", methods=["POST"]) -def get_new_games(): +@app.route("/random-games", methods=["POST"]) +def get_random_games(): print("Creating new games...") - GAME_GENERATOR.create_games(COURT_LIST, PLAYER_LIST) + GAME_GENERATOR.create_random_games(COURT_LIST, PLAYER_LIST) + return render_template( + "games.j2", + games=GAME_GENERATOR.games, + ) + + +@app.route("/skilled-games", methods=["POST"]) +def get_skilled_games(): + print("Creating new games...") + GAME_GENERATOR.create_skilled_games(COURT_LIST, PLAYER_LIST) return render_template( "games.j2", games=GAME_GENERATOR.games, |
