From dc07f825b0024265578f77fb87fa6a49b32aad95 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Tue, 31 Aug 2021 17:43:09 +0200 Subject: [PATCH] little adjustments --- server/crossword_generator.py | 4 ++-- server/session.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/server/crossword_generator.py b/server/crossword_generator.py index 47226f0..032425c 100644 --- a/server/crossword_generator.py +++ b/server/crossword_generator.py @@ -812,8 +812,8 @@ def create_word_grid(w: int, words = list(db.keys()) n_words = len(words) - min_solution_length = 10 - max_solution_length = 20 + min_solution_length = 12 + max_solution_length = 30 solution_word_locations = None diff --git a/server/session.py b/server/session.py index 16936f5..68f09dd 100644 --- a/server/session.py +++ b/server/session.py @@ -46,7 +46,14 @@ class Session(object): def get_crossword(self, lang: str = "en", difficulty: int = 0) -> crossword.Crossword: if self.crossword is None: - self.create_crossword(lang=lang, difficulty=difficulty) + size = 20 + if difficulty == 0: + size = 15 + if difficulty == 1: + size = 20 + if difficulty == 2: + size = 30 + self.create_crossword(width = size, height = size, lang=lang, difficulty=difficulty) return self.crossword