mirror of
https://codeberg.org/cblanken/boggler.git
synced 2026-07-26 03:29:26 -04:00
Fix bug loading duplicate wordlist for multi-letter blocks
This commit is contained in:
+8
-4
@@ -386,11 +386,15 @@ def build_full_boggle_tree(board: BoggleBoard, wordlist_path: str) -> dict[str,
|
|||||||
index = {}
|
index = {}
|
||||||
|
|
||||||
print("Reading in wordlists...")
|
print("Reading in wordlists...")
|
||||||
for letter in alphabet:
|
for letters in alphabet:
|
||||||
filename = "words_" + letter[0] + ".txt"
|
if letters[0] in index:
|
||||||
print(f">> {letter}: {filename}")
|
index[letters] = index[letters[0]]
|
||||||
|
continue
|
||||||
|
|
||||||
|
filename = "words_" + letters[0] + ".txt"
|
||||||
|
print(f">> {letters}: {filename}")
|
||||||
wordlist = read_wordlist(path.join(path.abspath(wordlist_path), filename))
|
wordlist = read_wordlist(path.join(path.abspath(wordlist_path), filename))
|
||||||
index[letter] = wordlist
|
index[letters] = wordlist
|
||||||
|
|
||||||
print("Generating WordTrees...")
|
print("Generating WordTrees...")
|
||||||
params = [ [alphabet, board, cell, index[cell.letters] ] for cell in board.board.values()]
|
params = [ [alphabet, board, cell, index[cell.letters] ] for cell in board.board.values()]
|
||||||
|
|||||||
Reference in New Issue
Block a user