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)