feat(wordgame): add multiplayer PvP word guessing cog#184
Merged
Conversation
Thread-based Wordle-style game. Anyone can start via slash command; guesses are typed freely in the thread. Scoring is global — first player to claim a (letter, position) pair takes the points; no one else can score it. Full word guess earns +2 bonus. Up to 3 guesses per player; game ends when all are done or an admin force-ends via command or scoreboard button. Bundles ENABLE word list (public domain) split into a curated answer pool (~6k words, lengths 3-8) and a broader valid-guess dictionary (~80k). Word length is configurable at game start.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
wordgamecog — a multiplayer PvP word-guessing game (Wordle-style) played entirely inside Discord threads. Anyone in a guild can start a game; players compete for points by probing letters rather than racing to guess the word.Changes
wordgame/wordgame.py— main cog:/wordgame start [length]slash command,[p]wordgame endadmin prefix command,on_messagelistener for in-thread guess processing, live scoreboard editingwordgame/game.py— pure scoring logic:compute_feedback(produces?!-strings, Wordle-style duplicate handling),compute_score(global position-claim tracking, word bonus), word-list helperswordgame/views.py—ScoreboardViewwith a persistent 🔚 End Game button (admin-only); survives bot restarts via stablecustom_idwordgame/data/answers.txt— ~6k curated answer words (ENABLE list intersected with Google 10k common words, lengths 3–8)wordgame/data/valid_words.txt— ~80k valid-guess dictionary (full ENABLE public-domain list, lengths 3–8)How it works
/wordgame start [length=5]picks a random word, posts an announcement in the channel, and creates a thread from it! ? -per letter)(letter, position)pair, +2 bonus for guessing the full word[p]wordgame endor the 🔚 button on the scoreboardConfig— active games resume after a bot restartTesting
python -m py_compile wordgame/*.py✅flake8 wordgame/ --max-line-length=100✅Risk
Confignamespace (active_gamesper guild)on_messagelistener is scoped to active game threads only; no impact on other channels