feat: Add Mathdoku game to Sir Lancebot#1732
Open
daDevBoat wants to merge 74 commits intopython-discord:mainfrom
Open
feat: Add Mathdoku game to Sir Lancebot#1732daDevBoat wants to merge 74 commits intopython-discord:mainfrom
daDevBoat wants to merge 74 commits intopython-discord:mainfrom
Conversation
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.
Co-authors
Co-authored-by: JannisHaeffner jannis.haeffner@yahoo.de
Co-authored-by: djonte djonatanbolenius@gmail.com
Co-authored by: arpega75 arnau.pelechano@gmail.com
Co-authored by: knasssss alexander.mannertorn@gmail.com
Relevant Issues
Closes #989
Description
Implement a mathdoku game, in the style proposed by the issue.
The
Mathdokufeature is implemented as a subsystem across three modules with clear separation of responsibilities.1. Game Logic (
mathdoku.py)This module contains the core game model:
This module is independent from Discord commands, so game correctness can be verified independently from the bot's event handling.
2. Board Parsing (
mathdoku_parser.py)This module reads
mathdoku_boards.txt, extract board definitions, buildsGridobjects, assign blocks and operations, and loads the correct solution values.This module acts as the entry point for board data, transforming raw text into structured game objects ready to be used by the game logic.
3. Discord Integration (
mathdoku_integration.py)This module connects the game to Discord and manages the full interaction flow with the player:
This module contains no game rules. It receives player input messages,
delegates to the game logic, and sends the result back to Discord.
How to run and play
Start a mathdoku game by typing
.md start SIZE DIFFICULTYwhere size can be any integer from 3-9, and difficulty must be eithereasy,mediumorhard.You fill in a number by typing its position, followed by your guess. For example:
A1 3to put number 3 in field A1 (top left corner)To display further rules click the book emoji
Did you: