Skip to content

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

Merged
salazarsebas merged 5 commits intosalazarsebas:mainfrom
miguelnietoa:feat/sudoku-example
Mar 26, 2026
Merged

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

Conversation

@miguelnietoa
Copy link
Copy Markdown
Contributor

@miguelnietoa miguelnietoa commented Mar 26, 2026

Closes #66

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
Copy Markdown

drips-wave bot commented Mar 26, 2026

@miguelnietoa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown
Owner

@salazarsebas salazarsebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@salazarsebas salazarsebas merged commit a0383a8 into salazarsebas:main Mar 26, 2026
1 check passed
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.

feat: implement Sudoku with constraint validation and deterministic puzzle state

2 participants