boundary cond
This commit is contained in:
parent
be964567e6
commit
00c493e492
4
app.py
4
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))
|
||||
|
@ -2,7 +2,7 @@
|
||||
{% block body %}
|
||||
<a href="{{url_for('init_random_game')}}">Random game</a>
|
||||
<form method="post" action="{{url_for('init_deterministic_game')}}">
|
||||
<label>Predefined (0 to {{ num_games }})</label>
|
||||
<label>Deterministic (0 to {{ num_games }})</label>
|
||||
<input type="number" min="0" max="{{ num_games }}" name="game_id" autofocus/>
|
||||
<input type="submit">
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user