- commit
- 7d01c023feb3e18f995757261aecb2c90689e2db
- parent
- 58c408d991d88bf4dc958be282e713a95763026b
- author
- Dami <dami.etoile@gmail.com>
| M | README.md | 54 | +++++++++++++++++++----------- |
| M | fillomino/ | 27 | ++++++++++++++- |
| M | fillomino/ | 3 | +- |
| M | hashiwokakero/ | 2 | +- |
| M | hashiwokakero/ | 3 | +- |
| M | hitori/ | 2 | +- |
| M | hitori/ | 3 | +- |
| M | lightsout/ | 2 | +- |
| M | lightsout/ | 2 | +- |
| M | nonogram/ | 1 | - |
| M | nonogram/ | 2 | +- |
| M | nurikabe/ | 1 | - |
| M | nurikabe/ | 2 | +- |
| M | rippleeffect/ | 24 | +++++++++++++- |
| M | rippleeffect/ | 2 | +- |
| M | shikaku/ | 1 | - |
| M | shikaku/ | 2 | +- |
| M | spellpuzzle/ | 2 | +- |
| M | sudoku/ | 1 | - |
| M | sudoku/ | 2 | +- |
| M | sudokurgb/ | 1 | - |
| M | sudokurgb/ | 2 | +- |
| M | takuzu/ | 1 | - |
| M | takuzu/ | 2 | +- |
| M | takuzuplus/ | 3 | -- |
| M | takuzuplus/ | 2 | +- |
| M | wordsearch/ | 1 | - |
| M | wordsearch/ | 2 | +- |
@@ -2,19 +2,19 @@
22 33 A terminal-based puzzle game collection built with [Bubble Tea](https://github.com/charmbracelet/bubbletea).44 5-Twelve puzzle types, multiple difficulty modes, daily and weekly deterministic challenges, XP progression, 365 color themes, and an explicit game catalog for adding new games.5+Fourteen puzzle games, multiple difficulty modes, daily and weekly deterministic challenges, XP progression, 365 theme options, and an explicit built-in registry plus metadata catalog for adding new games.66 77 88 99 ## Features1010 11-- **13 puzzle games** -- Fillomino, Nonogram, Nurikabe, Ripple Effect, Sudoku, Shikaku, Spell Puzzle, Word Search, Hashiwokakero, Hitori, Lights Out, Takuzu, Takuzu+11+- **14 puzzle games** -- Fillomino, Nonogram, Nurikabe, Ripple Effect, Shikaku, Sudoku, Sudoku RGB, Spell Puzzle, Word Search, Hashiwokakero, Hitori, Lights Out, Takuzu, Takuzu+1212 - **Daily puzzles** -- A unique puzzle generated each day using deterministic seeding. Same date, same puzzle for everyone. Streak tracking rewards consecutive daily completions.1313 - **Weekly gauntlet** -- Each ISO calendar week has a shared 99-puzzle ladder. The current week unlocks sequentially from `#01` to `#99`; past weeks can be reviewed from completed saves only.1414 - **XP and leveling** -- Per-category levels based on victories. Harder modes yield more XP. Daily puzzles grant 2x XP, and weekly puzzles add slot-based bonus XP.1515 - **Stats dashboard** -- Profile level, daily streak status, weekly completion progress, victory counts, and XP progress bars per category.1616 - **365 color themes** -- Live-preview theme picker with WCAG-compliant contrast enforcement. Dark and light themes included.17-- **Mouse support** -- Click and drag in Nonogram, Nurikabe, Shikaku, Spell Puzzle, and Word Search. Lights Out supports click-to-toggle.17+- **Mouse support** -- Drag interactions in Nonogram, Nurikabe, Shikaku, Spell Puzzle, and Word Search; click-to-focus in Fillomino, Hashiwokakero, Hitori, Sudoku, Sudoku RGB, Takuzu, and Takuzu+; click-to-toggle in Lights Out.1818 - **Seeded puzzles** -- Share a seed string to generate identical puzzles across sessions and machines.1919 - **Save/load persistence** -- Games auto-save to SQLite. Resume any in-progress game by name.2020 @@ -23,13 +23,14 @@ Twelve puzzle types, multiple difficulty modes, daily and weekly deterministic c
2323 | Game | Description | Modes |2424 |------|-------------|-------|2525 | **Fillomino** | Grow numbered regions to their exact sizes | Mini 5x5 through Expert 12x12 |26-| **Nonogram** | Fill cells to match row and column hints | Easy/Medium/Hard across 5x5, 10x10, 15x15, 20x20 |26+| **Nonogram** | Fill cells to match row and column hints | 10 named modes from 5x5 `Mini` to 20x20 `Massive` |2727 | **Nurikabe** | Build islands while keeping one connected sea | 5 modes from 5x5 to 12x12 |2828 | **Ripple Effect** | Place digits in cages without violating ripple distance | Mini 5x5 through Expert 9x9 |29-| **Shikaku** | Divide grid into rectangles matching cell counts | 5 modes from 7x7 to 11x11 |29+| **Shikaku** | Divide grid into rectangles matching cell counts | Mini 5x5 through Expert 12x12 |3030 | **Sudoku** | Classic 9x9 grid | Beginner, Easy, Medium, Hard, Expert, Diabolical |31+| **Sudoku RGB** | Fill a 9x9 grid with three symbols so each row, column, and box contains three of each | Beginner, Easy, Medium, Hard, Expert, Diabolical |3132 | **Spell Puzzle** | Connect letters to reveal crossword words and bonus anagrams | Beginner, Easy, Medium, Hard |32-| **Word Search** | Find hidden words in a letter grid | Easy, Medium, Hard (3-8 directions) |33+| **Word Search** | Find hidden words in a letter grid | Easy 10x10, Medium 15x15, Hard 20x20 |3334 | **Hashiwokakero** | Connect islands with bridges | 12 modes across 7x7 to 13x13 grids |3435 | **Hitori** | Shade cells to eliminate duplicates | 6 modes from 5x5 to 12x12 |3536 | **Lights Out** | Toggle lights to turn all off | Easy (3x3) to Extreme (9x9) |@@ -99,15 +100,19 @@ that week. Current-week puzzles unlock one at a time; older weeks are review-onl
99100 Start a new game directly:100101 101102 ```bash102-puzzletea new nonogram medium103+puzzletea new nonogram classic103104 puzzletea new fillomino "Hard 10x10"104105 puzzletea new ripple-effect "Medium 7x7"105106 puzzletea new sudoku hard107+puzzletea new ripeto expert106108 puzzletea new spell beginner107109 puzzletea new lights-out108-puzzletea new hashi easy110+puzzletea new hashi "Easy 7x7"109111 ```110112 113+Mode names are matched case-insensitively after normalizing spaces, hyphens,114+and underscores. Multi-word mode titles usually need quotes.115+111116 Resume and manage saved games:112117 113118 ```bash@@ -167,13 +172,13 @@ puzzletea --theme "Catppuccin Mocha"
167172 Flag aliases on the root command also work:168173 169174 ```bash170-puzzletea --new nonogram:medium175+puzzletea --new nonogram:classic171176 puzzletea --continue amber-falcon172177 ```173178 174179 ### CLI Aliases175180 176-Several shorthand names are accepted for games: `polyomino`/`regions` for Fillomino, `hashi`/`bridges` for Hashiwokakero, `lights` for Lights Out, `islands`/`sea` for Nurikabe, `ripple` for Ripple Effect, `spell`/`spellpuzzle` for Spell Puzzle, `binairo`/`binary` for Takuzu, `binario+` for Takuzu+, `words`/`ws` for Word Search, `rectangles` for Shikaku.181+Several shorthand names are accepted for games: `polyomino`/`regions` for Fillomino, `hashi`/`bridges` for Hashiwokakero, `lights` for Lights Out, `islands`/`sea` for Nurikabe, `ripple` for Ripple Effect, `spell`/`spellpuzzle` for Spell Puzzle, `rgb sudoku`/`ripeto`/`sudoku ripeto` for Sudoku RGB, `binairo`/`binary` for Takuzu, `takuzu plus`/`binario+`/`binario plus` for Takuzu+, `words`/`wordsearch`/`ws` for Word Search, and `rectangles` for Shikaku.177182 178183 ## Controls179184 @@ -185,7 +190,6 @@ Several shorthand names are accepted for games: `polyomino`/`regions` for Fillom
185190 | `Escape` | Return to the menu or go back |186191 | `Ctrl+R` | Reset puzzle |187192 | `Ctrl+H` | Toggle full help |188-| `Ctrl+E` | Toggle debug overlay |189193 | `Ctrl+C` | Quit |190194 191195 ### Navigation@@ -194,7 +198,7 @@ Arrow keys, WASD, and Vim bindings (`hjkl`) are supported for grid movement acro
194198 195199 ### Mouse196200 197-Nonogram, Nurikabe, Shikaku, Spell Puzzle, and Word Search support click and drag. Lights Out supports click to toggle. See each game's help for details.201+Nonogram, Nurikabe, Shikaku, Spell Puzzle, and Word Search support drag interactions. Fillomino, Hashiwokakero, Hitori, Sudoku, Sudoku RGB, Takuzu, and Takuzu+ support mouse focus or click-to-cycle interactions. Lights Out supports click to toggle. See each game's help for details.198202 199203 ## Game Persistence200204 @@ -321,7 +325,7 @@ All code must pass `gofumpt` and `golangci-lint` before committing. CI runs both
321325 322326 ## Adding a New Puzzle323327 324-PuzzleTea uses an explicit game catalog. To add a new puzzle type:328+PuzzleTea uses an explicit built-in registry plus a metadata catalog. To add a new puzzle type:325329 326330 ### 1. Create the game package327331 @@ -329,21 +333,26 @@ Create a directory (e.g., `mypuzzle/`) with these files:
329333 330334 | File | Purpose |331335 |------|---------|332-| `Gamemode.go` | Mode struct embedding `game.BaseMode`, `Spawn()`, `Modes`/`DailyModes`, and package-level `Definition` metadata |333-| `Model.go` | `Model` struct implementing `game.Gamer` |334-| `Export.go` | `Save` struct, `GetSave()`, `ImportModel()` for persistence |336+| `gamemode.go` | Mode structs embedding `game.BaseMode`, `Modes`, `ModeDefinitions`, package-level `Definition`, and the built-in `Entry` |337+| `model.go` | `Model` struct implementing `game.Gamer` |338+| `export.go` | `Save` struct, `GetSave()`, `ImportModel()` for persistence |335339 | `keys.go` | Game-specific `KeyMap` struct |336340 | `style.go` | lipgloss styling and rendering helpers |337341 | `generator.go` | Puzzle generation logic (if applicable) |338342 | `grid.go` | Grid type and serialization (for grid-based games) |343+| `help.md` | Embedded rules/help content wired into the runtime entry |344+| `print_adapter.go` | Optional printable export adapter for JSONL/PDF support |339345 | `mypuzzle_test.go` | Tests (table-driven, save/load round-trip, generator validation) |340346 | `README.md` | Game docs: rules, controls table, modes table, quick start examples |341347 342-### 2. Wire it into the central catalog348+Use `gameentry.BuildModeDefs(Modes)` and `gameentry.NewEntry(...)` so the349+package exposes both metadata and its validated runtime wiring.350+351+### 2. Wire it into the built-in registry343352 344-Edit the central catalog once:353+Edit the built-in registry once:345354 346-- **`catalog/catalog.go`**: Import the package and add its exported `Definition` to `All` (maintain alphabetical order).355+- **`registry/registry.go`**: Import the package and add its exported `Entry` to `all` (maintain alphabetical order).347356 348357 The game package's `Definition` owns:349358 @@ -355,6 +364,9 @@ The game package's `Definition` owns:
355364 - help content356365 - save/import function357366 367+The `catalog` package is built from the registered entries and remains the pure368+metadata index for names, aliases, and daily-mode lookup.369+358370 ### 3. Add a VHS preview359371 360372 - Create `vhs/<game>.tape` following the format in existing tapes.@@ -363,7 +375,9 @@ The game package's `Definition` owns:
363375 ### 4. Verify364376 365377 ```bash366-just fmt && just lint && just test378+just fmt379+just lint380+just test-short367381 ```368382 369383 See any existing game package (e.g., `nonogram/`) for the full pattern, and `AGENTS.md` for detailed conventions.@@ -2,6 +2,31 @@
22 33 Grow orthogonally connected regions until each region contains exactly the number written in its cells.44 5+6+7+## How to Play8+9+Each number belongs to a region whose area must match that number.10+Grow and merge regions until every filled cell belongs to a valid orthogonally11+connected group.12+13+1. Every region must be orthogonally connected.14+2. A region's area must equal the number written in its cells.15+3. Regions with the same number may not touch orthogonally.16+4. Given cells are fixed and cannot be changed.17+18+## Controls19+20+| Key | Action |21+|-----|--------|22+| Arrow keys / WASD / hjkl | Move cursor |23+| Mouse left-click | Focus a cell |24+| `1`-`9` | Place number |25+| `Backspace` / `Delete` | Clear cell |26+| `Ctrl+R` | Reset puzzle |27+| `Ctrl+H` | Toggle full help |28+| `Escape` | Return to main menu |29+530 ## Modes631 732 | Mode | Size | Notes |@@ -12,7 +37,7 @@ Grow orthogonally connected regions until each region contains exactly the numbe
1237 | Hard 10x10 | 10x10 | Longer chains |1338 | Expert 12x12 | 12x12 | Broad region planning |1439 15-## CLI40+## Quick Start1641 1742 ```bash1843 puzzletea new fillomino@@ -14,9 +14,10 @@ Fill the board so that each orthogonally connected region contains exactly as ma
1414 | Key | Action |1515 |-----|--------|1616 | `Arrows` / `wasd` / `hjkl` | Move cursor |17+| `Mouse left-click` | Focus a cell |1718 | `1`-`9` | Place number |1819 | `Backspace` / `Delete` | Clear cell |19-| `Ctrl+H` | Toggle help bar |20+| `Ctrl+H` | Toggle full help |2021 | `Ctrl+R` | Reset puzzle |2122 | `Escape` | Return to main menu |2223 @@ -25,10 +25,10 @@ bridges and all islands are connected.
2525 | Key | Action |2626 |-----|--------|2727 | Arrow keys / WASD / hjkl | Jump to nearest island |28+| Mouse left-click | Focus a clicked island |2829 | `Enter` / `Space` | Select island for bridging |2930 | `Ctrl+R` | Reset puzzle |3031 | `Ctrl+H` | Toggle full help |31-| `Ctrl+E` | Toggle debug overlay |3232 | `Escape` | Return to main menu |3333 3434 ### Bridge Mode (after selecting an island)@@ -16,6 +16,7 @@ Connect numbered islands with bridges to form a single connected group.
1616 | Key | Action |1717 |-----|--------|1818 | `Arrows` / `wasd` / `hjkl` | Jump to nearest island |19+| `Mouse left-click` | Focus a clicked island |1920 | `Enter` / `Space` | Select island |2021 2122 ### Bridge Mode@@ -35,7 +36,7 @@ double bridge, and a third time removes it.
3536 | Key | Action |3637 |-----|--------|3738 | `Ctrl+R` | Reset puzzle |38-| `Ctrl+H` | Toggle help bar |39+| `Ctrl+H` | Toggle full help |3940 | `Escape` | Return to main menu |4041 4142 ## Tips@@ -20,11 +20,11 @@ The puzzle is solved when all three rules hold simultaneously.
2020 | Key | Action |2121 |-----|--------|2222 | Arrow keys / WASD / hjkl | Move cursor |23+| Mouse left-click | Focus a cell |2324 | `x` | Shade cell (toggle) |2425 | `z` | Circle cell as confirmed white (toggle) |2526 | `Backspace` | Clear cell to unmarked |2627 | `Ctrl+H` | Toggle full help |27-| `Ctrl+E` | Toggle debug overlay |2828 | `Ctrl+R` | Reset puzzle |2929 | `Escape` | Return to main menu |3030 @@ -18,10 +18,11 @@ The puzzle is solved when all three rules hold simultaneously.
1818 | Key | Action |1919 |-----|--------|2020 | `Arrows` / `wasd` / `hjkl` | Move cursor |21+| `Mouse left-click` | Focus a cell |2122 | `x` | Toggle shade on cell |2223 | `z` | Toggle circle (confirmed white) |2324 | `Backspace` | Clear cell to unmarked |24-| `Ctrl+H` | Toggle help bar |25+| `Ctrl+H` | Toggle full help |2526 | `Ctrl+R` | Reset puzzle |2627 | `Escape` | Return to main menu |2728 @@ -15,10 +15,10 @@ goal is to turn every light off.
1515 | Key | Action |1616 |-----|--------|1717 | Arrow keys / WASD / hjkl | Move cursor |18+| Mouse left-click | Toggle light |1819 | `Enter` / `Space` | Toggle light |1920 | `Ctrl+R` | Reset puzzle |2021 | `Ctrl+H` | Toggle full help |21-| `Ctrl+E` | Toggle debug overlay |2222 | `Escape` | Return to main menu |2323 2424 ## Modes@@ -18,7 +18,7 @@ Toggle lights in a cross pattern to turn them all off.
1818 |-----|--------|1919 | `Arrows` / `wasd` / `hjkl` | Move cursor |2020 | `Enter` / `Space` | Toggle light |21-| `Ctrl+H` | Toggle help bar |21+| `Ctrl+H` | Toggle full help |2222 | `Ctrl+R` | Reset puzzle |2323 | `Escape` | Return to main menu |2424 @@ -21,7 +21,7 @@ Fill cells to match row and column hints, revealing a hidden pattern.
2121 | `z` | Fill cell (hold to paint) |2222 | `x` | Mark cell (hold to paint) |2323 | `Backspace` | Clear cell |24-| `Ctrl+H` | Toggle help bar |24+| `Ctrl+H` | Toggle full help |2525 | `Ctrl+R` | Reset puzzle |2626 | `Escape` | Return to main menu |2727 @@ -21,7 +21,7 @@ remaining undecided non-sea cells count as island.
2121 | `x` | Set sea |2222 | `z` | Set island |2323 | `Backspace` | Clear to unknown |24-| `Ctrl+H` | Toggle help bar |24+| `Ctrl+H` | Toggle full help |2525 | `Ctrl+R` | Reset puzzle |2626 | `Escape` | Return to main menu |2727 @@ -2,6 +2,28 @@
22 33 Place digits into irregular cages so each cage contains `1..n` exactly once, and matching digits stay outside each other’s ripple distance.44 5+6+7+## How to Play8+9+Each outlined cage must contain the digits `1..n` exactly once, where `n` is10+that cage's size. Matching digits also create a "ripple" that blocks the next11+`n-1` cells in the same row and column from containing the same value.12+13+Given cells are fixed. The puzzle is solved when every cell is filled and both14+the cage and ripple rules are satisfied.15+16+## Controls17+18+| Key | Action |19+|-----|--------|20+| Arrow keys / WASD / hjkl | Move cursor |21+| `1`-`9` | Place number |22+| `Backspace` / `Delete` | Clear cell |23+| `Ctrl+R` | Reset puzzle |24+| `Ctrl+H` | Toggle full help |25+| `Escape` | Return to main menu |26+527 ## Modes628 729 | Mode | Size | Notes |@@ -12,7 +34,7 @@ Place digits into irregular cages so each cage contains `1..n` exactly once, and
1234 | Hard 8x8 | 8x8 | Longer cages with lighter anchoring |1335 | Expert 9x9 | 9x9 | Winding large cages and sparse anchors |1436 15-## CLI37+## Quick Start1638 1739 ```bash1840 puzzletea new ripple-effect@@ -16,7 +16,7 @@ Fill each cage with the digits `1` through the cage size, then keep equal digits
1616 | `Arrows` / `wasd` / `hjkl` | Move cursor |1717 | `1`-`9` | Place number |1818 | `Backspace` / `Delete` | Clear cell |19-| `Ctrl+H` | Toggle help bar |19+| `Ctrl+H` | Toggle full help |2020 | `Ctrl+R` | Reset puzzle |2121 | `Escape` | Return to main menu |2222 @@ -27,7 +27,6 @@ clue and the clue's value equals the rectangle's area.
2727 | `Backspace` | Cancel preview or delete rectangle at cursor |2828 | `Ctrl+R` | Reset puzzle |2929 | `Ctrl+H` | Toggle full help |30-| `Ctrl+E` | Toggle debug overlay |3130 | `Escape` | Return to main menu |3231 3332 ### Expansion Mode (after selecting a clue)@@ -50,7 +50,7 @@ Expansion Mode so you can fine-tune with the keyboard.
5050 | Key | Action |5151 |-----|--------|5252 | `Ctrl+R` | Reset puzzle |53-| `Ctrl+H` | Toggle help bar |53+| `Ctrl+H` | Toggle full help |5454 | `Escape` | Return to main menu |5555 5656 ## Tips@@ -21,7 +21,7 @@ Connect letters from the bank to spell valid words.
2121 | `1` | Shuffle the visible bank order |2222 | `Enter` | Submit the traced word |2323 | `Backspace` | Delete the last traced letter |24-| `Ctrl+H` | Toggle help bar |24+| `Ctrl+H` | Toggle full help |2525 | `Ctrl+R` | Reset puzzle |2626 | `Escape` | Return to main menu |2727 @@ -18,7 +18,7 @@ Fill a 9x9 grid with digits so every row, column, and box is complete.
1818 | `Mouse left-click` | Focus a cell |1919 | `1`-`9` | Fill cell with digit |2020 | `Backspace` | Clear cell |21-| `Ctrl+H` | Toggle help bar |21+| `Ctrl+H` | Toggle full help |2222 | `Ctrl+R` | Reset puzzle |2323 | `Escape` | Return to main menu |2424 @@ -22,7 +22,7 @@ Inspired by Ripeto.
2222 | `Mouse left-click` | Focus a cell |2323 | `1` / `2` / `3` | Fill cell with `▲` / `■` / `●` |2424 | `Backspace` | Clear cell |25-| `Ctrl+H` | Toggle help bar |25+| `Ctrl+H` | Toggle full help |2626 | `Ctrl+R` | Reset puzzle |2727 | `Escape` | Return to main menu |2828 @@ -27,7 +27,6 @@ every cell is filled and all three rules are satisfied.
2727 | `Backspace` | Clear cell |2828 | `Ctrl+R` | Reset puzzle |2929 | `Ctrl+H` | Toggle full help |30-| `Ctrl+E` | Toggle debug overlay |3130 | `Escape` | Return to main menu |3231 3332 ## Modes@@ -24,7 +24,7 @@ error chip if a line goes over quota.
2424 | `z` / `0` | Place ● (filled) |2525 | `x` / `1` | Place ○ (open) |2626 | `Backspace` | Clear cell |27-| `Ctrl+H` | Toggle help bar |27+| `Ctrl+H` | Toggle full help |2828 | `Ctrl+R` | Reset puzzle |2929 | `Escape` | Return to main menu |3030 @@ -2,8 +2,6 @@
22 33 Fill the grid with two symbols while obeying the normal Takuzu rules plus fixed relation clues.44 5-6-75 ## How to Play86 97 Fill every empty cell with either a filled circle (●) or an open circle (○)@@ -29,7 +27,6 @@ cell is filled and all four rules are satisfied.
2927 | `Backspace` | Clear cell |3028 | `Ctrl+R` | Reset puzzle |3129 | `Ctrl+H` | Toggle full help |32-| `Ctrl+E` | Toggle debug overlay |3330 | `Escape` | Return to main menu |3431 3532 ## Modes@@ -24,7 +24,6 @@ The puzzle is solved when all words are found.
2424 | `Backspace` | Cancel current selection |2525 | `Ctrl+R` | Reset puzzle |2626 | `Ctrl+H` | Toggle full help |27-| `Ctrl+E` | Toggle debug overlay |2827 | `Escape` | Return to main menu |2928 3029 ## Modes@@ -22,7 +22,7 @@ Press `Backspace` to cancel a selection.
2222 | `Arrows` / `wasd` / `hjkl` | Move cursor |2323 | `Enter` / `Space` | Select start or confirm end |2424 | `Backspace` | Cancel current selection |25-| `Ctrl+H` | Toggle help bar |25+| `Ctrl+H` | Toggle full help |2626 | `Ctrl+R` | Reset puzzle |2727 | `Escape` | Return to main menu |2828