Limit targets to words at least as common as "murky"

This commit is contained in:
Juhani Krekelä 2022-02-23 03:10:44 +02:00
parent 0ac6546490
commit cd049240ea
1 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,14 @@ srcpath = sys.argv[1]
targetpath = sys.argv[2]
with open(srcpath, 'r') as f:
words = json.load(f)
all_words = json.load(f)
# 'murky' is the rarest word we'll use
# https://github.com/lynn/hello-wordl/blob/7da40c1f067eb1ec157d4c5b7a9bd8257ed39342/src/Game.tsx#L34
words = []
for word in all_words:
words.append(word)
if word == 'murky': break
# We only care about 5-letter words
words = [word for word in words if len(word) == 5]