Skip to content

Puzzle types#40

Open
OluRemiFour wants to merge 2 commits into
ThinknetCollective:mainfrom
OluRemiFour:puzzle-types
Open

Puzzle types#40
OluRemiFour wants to merge 2 commits into
ThinknetCollective:mainfrom
OluRemiFour:puzzle-types

Conversation

@OluRemiFour

Copy link
Copy Markdown

Closes #27

Done — implemented the requested refactor and additions.

What changed

Confirmed a Puzzle trait, registry, and builtins already existed under contracts/puzzle. They were used as designed.
Fixed a bug in the SequencePuzzle: the "next" term for the Fibonacci-like branch previously computed incorrectly (used sum of last two when terms vector already contained the next value). Adjusted the code to display first 5 terms and use the 6th as next.
Updated failing tests to match corrected deterministic behavior.
Added an examples/third_party_puzzle.rs file demonstrating a third-party-style puzzle that implements Puzzle and registers itself with PuzzleRegistry.
Updated CONTRIBUTING.md with a short guide showing how to add a new puzzle type and register it.
Verification

Ran cargo test in contracts/puzzle before changes (23 tests; 21 passed, 2 failed).
After edits, ran cargo test again: all 23 tests passed.
Committed changes to Git with the required Co-authored-by trailer.
Files changed

contracts/puzzle/src/sequence.rs — bug fix + test updates
examples/third_party_puzzle.rs — new example registering a third-party puzzle
CONTRIBUTING.md — short guide for adding puzzle types
Notes

The repository already had the Puzzle trait, PuzzleRegistry, built-in puzzles, and tests — the task mostly required wiring and a small bug fix to ensure behavior remained correct.

OluRemiFour and others added 2 commits July 21, 2026 21:24
…ibuting guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Introduce a plugin trait for custom puzzle types

1 participant