From 8c72fdb2be5dc573197f61bafa08912725399a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pelletier?= Date: Sun, 18 Sep 2022 00:12:01 -0400 Subject: [PATCH] =?UTF-8?q?correction=20fran=C3=A7ais=20et=20poids=20des?= =?UTF-8?q?=20mots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basic_ops.py | 4 ++-- file_ops.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/basic_ops.py b/basic_ops.py index da15731..794193a 100644 --- a/basic_ops.py +++ b/basic_ops.py @@ -148,7 +148,7 @@ def is_valid(possibility, grid, words): def score_candidate(candidate_word, new_words): - return len(candidate_word) + 10*len(new_words) + return len(candidate_word)**1.5 + 10*len(new_words) def add_word_to_grid(possibility, grid): @@ -318,4 +318,4 @@ def basic_grid_fill(grid, occ_goal, timeout, dim, words): if new_words: print("This also created the words:", new_words) - return added_words \ No newline at end of file + return added_words diff --git a/file_ops.py b/file_ops.py index c9663fb..cf7b013 100644 --- a/file_ops.py +++ b/file_ops.py @@ -42,7 +42,7 @@ def write_grid_to_file(grid, out_file="table.tex", out_pdf="out.pdf", keep_tex=F texfile.write(r"\usepackage{graphicx}" + "\n") texfile.write("\n") texfile.write(r"\begin{document}" + "\n") - texfile.write(r"\section*{Challenge}" + "\n") + texfile.write(r"\section*{Mots-croisés thématique}" + "\n") # Resize box texfile.write(r"\resizebox{\textwidth}{!}{") @@ -71,7 +71,7 @@ def write_grid_to_file(grid, out_file="table.tex", out_pdf="out.pdf", keep_tex=F # Write the words that were used if words: - texfile.write(r"\section*{Words used for the problem}" + "\n") + texfile.write(r"\section*{Mots utilisés dans ce mots-croisés}" + "\n") # Write in several columns texfile.write(r"\begin{multicols}{4}" + "\n") texfile.write(r"\noindent" + "\n") @@ -157,4 +157,4 @@ def write_grid_to_screen(grid, words_in_grid): print() print("Words:") - pprint.pprint(words_in_grid) \ No newline at end of file + pprint.pprint(words_in_grid)