feat: implement Sudoku with constraint validation and deterministic puzzle state#90
Open
miguelnietoa wants to merge 5 commits intosalazarsebas:mainfrom
Open
feat: implement Sudoku with constraint validation and deterministic puzzle state#90miguelnietoa wants to merge 5 commits intosalazarsebas:mainfrom
miguelnietoa wants to merge 5 commits intosalazarsebas:mainfrom
Conversation
|
Hey @miguelnietoa! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
4abefbd to
db79184
Compare
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 complete Sudoku game as a Soroban smart contract, following the same ECS patterns established by the Reversi example.
BoardComponent(81-cell Vec),FixedCellsComponent(immutable given cells),GameStatusComponent,MoveCountComponent, all stored under a singleWORLDkey asECSWorldStateInputValidationSystem(bounds + editability + range),PlacementValidationSystem(row/col/block constraints),BoardUpdateSystem,CompletionSystem/EndConditionSysteminit_game,submit_value,get_state,get_cell,is_solved; panics on any constraint violation so invalidtransactions are cleanly rejected by the chain
MATCH_LOG.mdwith the real testnet deployment(
CCF5MENLO56M4S72BF4H5KMU7XYO45VTB7GJ2O3BZFG7EWY6X3X2DBQO), solved in 51 moves;scripts/play.shto build, deploy, and solveend-to-end on testnet
Test plan
cargo testpasses inexamples/sudoku/cargo clippy --all-targets --all-features -- -D warningscleancargo fmt --checkcleanstellar contract buildproducessudoku.wasm./scripts/play.shdeploys and solves the puzzle on testnet (is_solvedreturnstrue)