Re-implement the word renewal mechanism to ensure better variety.
This commit is contained in:
parent
a3b68a2b22
commit
8afbe9cc9a
1 changed files with 2 additions and 2 deletions
|
@ -200,10 +200,10 @@ def generate_grid(words, dim):
|
|||
occupancy = 0
|
||||
while occupancy < 0.6:
|
||||
# Generate new possibilities, if needed
|
||||
if not possibilities:
|
||||
if len(possibilities) < 30:
|
||||
print("Getting new words!")
|
||||
sample = draw_words(words)
|
||||
possibilities = generate_possibilities(sample, dim)
|
||||
possibilities.extend(generate_possibilities(sample, dim))
|
||||
|
||||
# Add new possibility
|
||||
new = possibilities.pop(random.randint(0, len(possibilities)-1))
|
||||
|
|
Loading…
Reference in a new issue