Snapshot permission updates.

This commit is contained in:
dongar committed 2024-03-07 09:46:05 -06:00
1 parent 414380740f
commit d570b16b60
15 files changed
+540 -502

No files matched your search

+22 -3
View File
@@ -61,10 +61,29 @@ class SimilaritySolver(object):
for word in wordle_dictionary:
scored_words[word] = self._score_word(position_matches, word_matches, word)
result = list(wordle_dictionary)
result.sort(key=lambda word: scored_words[word], reverse=True)
# Return as list of (word, score) sorted by high-score, word.
result = sorted(scored_words.items(), key=lambda kv: kv[0])
result = sorted(result, key=lambda kv: kv[1], reverse=True)
return result
return [(word, scored_words[word]) for word in result]
class LimitsSolver(object):
def scored_words(self, words=dictionary.words()):
# word: score
scored_words = dict()
for word in words:
reduced = const.filter_words(words)
# Our score is how many words did we remove from consideration.
score = len(words) - len(reduced)
scored_words[word] = score
# Return as list of (word, score) sorted by high-score, word.
result = sorted(scored_words.items(), key=lambda kv: kv[0])
result = sorted(result, key=lambda kv: kv[1], reverse=True)
return result
if __name__ == "__main__":