Description
When the target word chosen by random.choice() is not in the frWac vocabulary, every guess from every player returns:
'word' is not in the vocabulary.
There is no indication that the game itself is broken. The session is unplayable but players have no way of knowing why.
Location
# bot/bot.py
target = random.choice(words)
self._game_state.start_new_game(target, diff)
No vocabulary check is performed before launching the round.
Proposed fix
Filter the word list to vocabulary members before selecting a target:
in_vocab = [w for w in words if engine.score_guess(w, w) is not None]
if not in_vocab:
await ctx.send("No playable words found for this difficulty. Check the word list.")
return
target = random.choice(in_vocab)
Or add an is_in_vocab(word: str) -> bool helper on the engine for clarity.
Impact
- Silent broken games — unplayable with no feedback
- Affects both
EASY and HARD/MEDIUM difficulties depending on which words in the list are OOV
- Risk is higher for
interest_words_d.txt which contains rare/literary words (see related issue)
Files
bot/bot.py — game start logic
game/engine.py — add is_in_vocab() helper
Description
When the target word chosen by
random.choice()is not in the frWac vocabulary, every guess from every player returns:There is no indication that the game itself is broken. The session is unplayable but players have no way of knowing why.
Location
No vocabulary check is performed before launching the round.
Proposed fix
Filter the word list to vocabulary members before selecting a target:
Or add an
is_in_vocab(word: str) -> boolhelper on the engine for clarity.Impact
EASYandHARD/MEDIUMdifficulties depending on which words in the list are OOVinterest_words_d.txtwhich contains rare/literary words (see related issue)Files
bot/bot.py— game start logicgame/engine.py— addis_in_vocab()helper