Skip to content

feat: implement Sudoku with constraint validation and deterministic puzzle state#90

Open
miguelnietoa wants to merge 5 commits intosalazarsebas:mainfrom
miguelnietoa:feat/sudoku-example
Open

feat: implement Sudoku with constraint validation and deterministic puzzle state#90
miguelnietoa wants to merge 5 commits intosalazarsebas:mainfrom
miguelnietoa:feat/sudoku-example

Conversation

@miguelnietoa
Copy link
Contributor

Summary

Adds a complete Sudoku game as a Soroban smart contract, following the same ECS patterns established by the Reversi example.

  • ComponentsBoardComponent (81-cell Vec), FixedCellsComponent (immutable given cells), GameStatusComponent,
    MoveCountComponent, all stored under a single WORLD key as ECSWorldState
  • SystemsInputValidationSystem (bounds + editability + range), PlacementValidationSystem (row/col/block constraints),
    BoardUpdateSystem, CompletionSystem / EndConditionSystem
  • Contract APIinit_game, submit_value, get_state, get_cell, is_solved; panics on any constraint violation so invalid
    transactions are cleanly rejected by the chain
  • Tests — 15 unit tests covering initialisation, move validation, constraint rejection, and full 51-move solution
  • Docs — README with ECS design, API reference, and usage guide; MATCH_LOG.md with the real testnet deployment
    (CCF5MENLO56M4S72BF4H5KMU7XYO45VTB7GJ2O3BZFG7EWY6X3X2DBQO), solved in 51 moves; scripts/play.sh to build, deploy, and solve
    end-to-end on testnet

Test plan

  • cargo test passes in examples/sudoku/
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • stellar contract build produces sudoku.wasm
  • ./scripts/play.sh deploys and solves the puzzle on testnet (is_solved returns true)

@drips-wave
Copy link

drips-wave bot commented Mar 26, 2026

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., Closes #123), or by clicking a button below:

Issue Title
#66 feat: implement Sudoku with constraint validation and deterministic puzzle state Link to this issue

ℹ️ Learn more about linking PRs to issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant