diff --git a/app.py b/app.py index 45e86c9..c0ce2ce 100644 --- a/app.py +++ b/app.py @@ -9,7 +9,7 @@ from play import build_non_letter_hint, build_letter_hint app = Flask(__name__) app.config['SECRET_KEY'] = sensitive.SECRET_KEY -NUM_GAMES = 4593 +NUM_GAMES = len(list(cat_words())) - 1 GUESS_SPLITTER = '|' STATE_PLAYING = 'PLAYING' STATE_WIN = 'WIN' @@ -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)) diff --git a/templates/home.html b/templates/home.html index 34dc500..8c725a4 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,7 +2,7 @@ {% block body %} Random game
- +