✨
This commit is contained in:
11
main.py
11
main.py
@@ -37,6 +37,7 @@ def question():
|
||||
return flask.redirect("/")
|
||||
|
||||
game_state = decode_state(game_encoding)
|
||||
empty = 36-sum(game_state)
|
||||
game_state[int(question)] = False
|
||||
game_encoding = encode_state(game_state)
|
||||
question_text = QUESTIONS["questions"][int(question)%6][int(question)//6][0]
|
||||
@@ -44,14 +45,16 @@ def question():
|
||||
if question_text == "":
|
||||
return flask.redirect("/?game_state="+game_encoding)
|
||||
elif question_text == "$":
|
||||
return flask.render_template("question picture.html", question=int(question), game_state=game_encoding)
|
||||
return flask.render_template("question picture.html", question=int(question), game_state=game_encoding, empty=empty)
|
||||
|
||||
|
||||
return flask.render_template("question.html", question=int(question), question_text=question_text, game_state=game_encoding)
|
||||
return flask.render_template("question.html", question=int(question), question_text=question_text, game_state=game_encoding, empty=empty)
|
||||
|
||||
@app.route('/answer')
|
||||
def answer():
|
||||
game_encoding = flask.request.args.get("game_state")
|
||||
game_state = decode_state(game_encoding)
|
||||
empty = 35-sum(game_state)
|
||||
question = flask.request.args.get("question")
|
||||
if game_encoding is None or question is None:
|
||||
return flask.redirect("/")
|
||||
@@ -61,9 +64,9 @@ def answer():
|
||||
if answer_text == "":
|
||||
return flask.redirect("/?game_state="+game_encoding)
|
||||
elif answer_text == "$":
|
||||
return flask.render_template("answer picture.html", question=int(question), game_state=game_encoding)
|
||||
return flask.render_template("answer picture.html", question=int(question), game_state=game_encoding, empty=empty)
|
||||
|
||||
return flask.render_template("answer.html", question=int(question), answer_text=answer_text, game_state=game_encoding)
|
||||
return flask.render_template("answer.html", question=int(question), answer_text=answer_text, game_state=game_encoding, empty=empty)
|
||||
|
||||
@app.route('/static/<path:path>')
|
||||
def flag_image(path):
|
||||
|
||||
Reference in New Issue
Block a user