Skip to content

Add Pattern Recall puzzle framework and integrate into Perbug game - #387

Open
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-pattern-recall-puzzle-j7tzre
Open

Add Pattern Recall puzzle framework and integrate into Perbug game#387
ercmine wants to merge 1 commit into
mainfrom
codex/implement-perbug-pattern-recall-puzzle-j7tzre

Conversation

@ercmine

@ercmine ercmine commented Mar 28, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a deterministic, node-seeded puzzle subsystem so nodes can surface location-tied mini-games with difficulty tuning and analytics.
  • Implement a Pattern Recall puzzle as the first puzzle type with generation, validation, lifecycle, and UI to enable reward/energy hooks.

Description

  • Added a lightweight puzzle framework in puzzles/perbug_puzzle_framework.dart with deterministic seeding (seededRandom) and common types/models.`
  • Implemented Pattern Recall pieces: pattern_recall_generator.dart, pattern_recall_models.dart, and pattern_recall_validator.dart to generate deterministic sequences, compute difficulty knobs, and validate player input.
  • Integrated puzzle state and flow into the game controller by extending PerbugGameState and PerbugGameController with methods to launch, preview, input, retry, abandon, and close pattern sessions and to record lifecycle events and puzzleEvents.
  • Added a modal UI PatternRecallPuzzleSheet and a launch button in perbug_game_page.dart to start and interact with Pattern Recall puzzles.
  • Added unit tests in app/test/perbug_pattern_recall_test.dart covering deterministic generation, tuning/difficulty effects, validator tolerance behavior, and controller lifecycle/flow.

Testing

  • Ran the new unit test file with flutter test (test: app/test/perbug_pattern_recall_test.dart), which exercises generator determinism, tuning changes, validator behavior, and controller session handling and lifecycle events; tests succeeded.
  • Verified controller-level flows for blocking input before preview, recording preview_completed/puzzle_succeeded events, and reusing in-progress sessions via unit tests, all passing.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant