allow game 0

This commit is contained in:
Daniel Tsvetkov 2022-01-18 22:07:09 +01:00
parent cf2ed98e38
commit be964567e6

2
app.py
View File

@ -39,7 +39,7 @@ def init_random_game():
@app.route('/init/deterministic', methods=['post'])
def init_deterministic_game():
game_id = request.form.get('game_id')
if not game_id.isdigit() or not 0 < int(game_id) < NUM_GAMES:
if not game_id.isdigit() or not 0 <= int(game_id) < NUM_GAMES:
flash("game_id must be between 0 and {}".format(NUM_GAMES))
return redirect(url_for('home'))
return redirect(url_for('init_deterministic_game_id', game_id=game_id))