correction français et poids des mots

This commit is contained in:
François Pelletier 2022-09-18 00:12:01 -04:00
parent ff6dae5673
commit 8c72fdb2be
2 changed files with 5 additions and 5 deletions

View file

@ -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
return added_words

View file

@ -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)
pprint.pprint(words_in_grid)