From 8ee14b3984b8135bdfcccedd6c0dd41c8bb96349 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Mon, 9 Sep 2024 16:38:33 +0200 Subject: [PATCH] :sparkles: --- main.py | 11 +++++++---- templates/answer picture.html | 3 ++- templates/answer.html | 3 ++- templates/main_board.html | 2 +- templates/question picture.html | 3 ++- templates/question.html | 3 ++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index ade8d26..ef18a58 100644 --- a/main.py +++ b/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/') def flag_image(path): diff --git a/templates/answer picture.html b/templates/answer picture.html index 7f5f710..d33380e 100644 --- a/templates/answer picture.html +++ b/templates/answer picture.html @@ -8,7 +8,8 @@
- ${{ (question//6+1) ** 4 + 2*((question//6+1) ** 3) + 7*((question//6+1)**2) + (question//6+1) * 33 + (((question%6)+2)%3)**2 + (question%6) * 87 - ((question%6)+3)**2 - ((question%6)+2)**3 + (question//6+1)*(((question%6) + 2)%3) + 24 }} + ${{(question//6+1)*((1+empty)*7-2)}} +
\ No newline at end of file diff --git a/templates/answer.html b/templates/answer.html index 8da91ba..0c24e60 100644 --- a/templates/answer.html +++ b/templates/answer.html @@ -8,7 +8,8 @@ {{answer_text}}
- ${{ (question//6+1) ** 4 + 2*((question//6+1) ** 3) + 7*((question//6+1)**2) + (question//6+1) * 33 + (((question%6)+2)%3)**2 + (question%6) * 87 - ((question%6)+3)**2 - ((question%6)+2)**3 + (question//6+1)*(((question%6) + 2)%3) + 24 }} + ${{(question//6+1)*((1+empty)*7-2)}} +
\ No newline at end of file diff --git a/templates/main_board.html b/templates/main_board.html index e020bb9..31b9fa0 100644 --- a/templates/main_board.html +++ b/templates/main_board.html @@ -15,7 +15,7 @@ {% for j in range(0,6): %} {% if draw_cells[(i-1)*6+j] %} - ${{(i*250)-(i**2*empty)}} + ${{i*((1+empty)*7-2)}} {% endif %} {% endfor %} diff --git a/templates/question picture.html b/templates/question picture.html index a48c678..21b90d9 100644 --- a/templates/question picture.html +++ b/templates/question picture.html @@ -8,7 +8,8 @@
- ${{ (question//6+1) ** 4 + 2*((question//6+1) ** 3) + 7*((question//6+1)**2) + (question//6+1) * 33 + (((question%6)+2)%3)**2 + (question%6) * 87 - ((question%6)+3)**2 - ((question%6)+2)**3 + (question//6+1)*(((question%6) + 2)%3) + 24 }} + ${{(question//6+1)*((1+empty)*7-2)}} +
\ No newline at end of file diff --git a/templates/question.html b/templates/question.html index 9302612..e3f4f90 100644 --- a/templates/question.html +++ b/templates/question.html @@ -8,7 +8,8 @@ {{question_text}}
- ${{ (question//6+1) ** 4 + 2*((question//6+1) ** 3) + 7*((question//6+1)**2) + (question//6+1) * 33 + (((question%6)+2)%3)**2 + (question%6) * 87 - ((question%6)+3)**2 - ((question%6)+2)**3 + (question//6+1)*(((question%6) + 2)%3) + 24 }} + ${{(question//6+1)*((1+empty)*7-2)}} +
\ No newline at end of file