clone

fifteen puzzle games for the terminal, with daily puzzles, weekly ladders and xp, built on bubble tea

chore/app-model-decomp
puzzletea / openspec / specs / lightsout / spec.md
spec.md 2.6K rendered
1## Purpose2Document the shipped Lights Out built-in game behavior.34## Requirements56### Requirement: Registry Metadata7Lights Out SHALL be registered as a built-in game with canonical description "Turn the lights off.", aliases `lights`, variants `Lights Out (default 2000 Elo)`, and daily legacy modes `medium, hard`.89#### Scenario: Resolve Lights Out10- **WHEN** the registry resolves the canonical name or any alias11- **THEN** it returns the Lights Out entry with help text, import behavior, variant metadata, and legacy mode compatibility1213### Requirement: Variant Elo Creation14Lights Out MUST support the current variant plus target Elo creation path, using the variant default Elo when no explicit target is supplied.1516#### Scenario: Spawn Lights Out by Elo17- **WHEN** the user selects the Lights Out variant and a target Elo from 0 through 300018- **THEN** PuzzleTea spawns a deterministic Lights Out puzzle and records target, actual, and confidence metadata when generation reports it1920### Requirement: Legacy Mode Compatibility21Lights Out SHALL preserve legacy named modes as compatibility presets that map to the Lights Out variant and preset Elo values: Easy (0 Elo), Medium (1000 Elo), Hard (2000 Elo), Extreme (3000 Elo).2223#### Scenario: Use legacy mode title24- **WHEN** the user supplies a legacy Lights Out mode title through CLI or deterministic daily metadata25- **THEN** PuzzleTea resolves it to the Lights Out variant and the registered preset Elo2627### Requirement: Puzzle Rules28The Lights Out runtime MUST let players toggle a selected light and its orthogonal neighbors, and the puzzle is solved only when every light is off.2930#### Scenario: Check solved state31- **WHEN** the player fills the board or word state32- **THEN** Lights Out reports solved only when all rule constraints are satisfied3334### Requirement: Save Load And Interaction35Lights Out SHALL serialize enough state for resume/import, reset to its initial puzzle, expose debug and full-help data, and support its shipped interaction model. Keyboard toggling is required, and mouse click-to-toggle support MUST be available.3637#### Scenario: Resume saved Lights Out38- **WHEN** a saved Lights Out payload is imported39- **THEN** the restored game preserves givens, player entries, cursor/selection state where applicable, and solved-state behavior4041### Requirement: Print Export Support42Lights Out MUST remain excluded from printable export until a print adapter is provided.4344#### Scenario: Export Lights Out45- **WHEN** Lights Out is included in a JSONL or PDF export flow46- **THEN** PuzzleTea follows the registered print support behavior for that game