clone

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

update daily game definition to be package internal

Dami committed c9705e5
commit
c9705e5c2f3c1126a93e8b9bbaecf7bffc9b2b39
parent
50495ad15465aa27199b6e671c2c3ba9f76b20ce
author
Dami <dami.etoile@gmail.com>
8 files changed, +74 -15
Mdaily.go48+++++++++++++++++++++---------
Mhashiwokakero/Gamemode.go6++++
Mhitori/Gamemode.go6++++
Mlightsout/Gamemode.go6++++
Mnonogram/Gamemode.go6++++
Msudoku/Gamemode.go6++++
Mtakuzu/Gamemode.go6++++
Mwordsearch/Gamemode.go5+++
M daily.go +33 -15
@@ -14,6 +14,8 @@ import (
1414 "github.com/FelineStateMachine/puzzletea/sudoku"1515 "github.com/FelineStateMachine/puzzletea/takuzu"1616 "github.com/FelineStateMachine/puzzletea/wordsearch"17+18+ "github.com/charmbracelet/bubbles/list"1719 )1820 1921 // dailyEntry pairs a SeededSpawner with metadata for the eligible daily pool.
@@ -23,21 +25,37 @@ type dailyEntry struct {
2325 mode string2426 }2527 26-// eligibleDailyModes is the curated pool of quick (<10 min) modes for daily rotation.27-var eligibleDailyModes = []dailyEntry{28- {nonogram.NewMode("Standard", "10x10 grid, ~67% filled. Classic size, dense hints.", 10, 10, 0.67), "Nonogram", "Standard"},29- {nonogram.NewMode("Classic", "10x10 grid, ~52% filled. The typical nonogram experience.", 10, 10, 0.52), "Nonogram", "Classic"},30- {sudoku.NewMode("Easy", "38\u201344 clues. Naked Singles.", 38), "Sudoku", "Easy"},31- {sudoku.NewMode("Medium", "32\u201337 clues. Hidden Pairs / Pointing.", 32), "Sudoku", "Medium"},32- {takuzu.NewMode("Medium", "8\u00d78 grid, ~40% clues. Larger grid, moderate deduction.", 8, 0.40), "Takuzu", "Medium"},33- {takuzu.NewMode("Tricky", "10\u00d710 grid, ~38% clues. Uniqueness rule needed.", 10, 0.38), "Takuzu", "Tricky"},34- {hashiwokakero.NewMode("Easy 9x9", "9x9 grid with 12-16 islands.", 9, 9, 12, 16), "Hashiwokakero", "Easy 9x9"},35- {hashiwokakero.NewMode("Medium 7x7", "7x7 grid with 12-15 islands.", 7, 7, 12, 15), "Hashiwokakero", "Medium 7x7"},36- {hitori.NewMode("Easy", "6\u00d76 grid, straightforward logic.", 6, 0.32), "Hitori", "Easy"},37- {hitori.NewMode("Medium", "8\u00d78 grid, moderate challenge.", 8, 0.30), "Hitori", "Medium"},38- {lightsout.NewMode("Medium", "5x5 grid", 5, 5), "Lights Out", "Medium"},39- {lightsout.NewMode("Hard", "7x7 grid", 7, 7), "Lights Out", "Hard"},40- {wordsearch.NewMode("Easy 10x10", "Find 6 words in a 10x10 grid.", 10, 10, 6, 3, 5, []wordsearch.Direction{wordsearch.Right, wordsearch.Down, wordsearch.DownRight}), "Word Search", "Easy 10x10"},28+// dailyPool maps game type names to their DailyModes exports.29+// Each package owns which of its modes are eligible for daily rotation.30+var dailyPool = []struct {31+ gameType string32+ modes []list.Item33+}{34+ {"Nonogram", nonogram.DailyModes},35+ {"Sudoku", sudoku.DailyModes},36+ {"Takuzu", takuzu.DailyModes},37+ {"Hashiwokakero", hashiwokakero.DailyModes},38+ {"Hitori", hitori.DailyModes},39+ {"Lights Out", lightsout.DailyModes},40+ {"Word Search", wordsearch.DailyModes},41+}42+43+// eligibleDailyModes is the flattened pool built from each package's DailyModes.44+var eligibleDailyModes = buildEligibleDailyModes()45+46+func buildEligibleDailyModes() []dailyEntry {47+ var entries []dailyEntry48+ for _, p := range dailyPool {49+ for _, item := range p.modes {50+ s := item.(game.SeededSpawner)51+ entries = append(entries, dailyEntry{52+ spawner: s,53+ gameType: p.gameType,54+ mode: item.(game.Mode).Title(),55+ })56+ }57+ }58+ return entries4159 }4260 4361 // dailySeed returns a deterministic int64 seed derived from the date.
M hashiwokakero/Gamemode.go +6 -0
M hitori/Gamemode.go +6 -0
M lightsout/Gamemode.go +6 -0
M nonogram/Gamemode.go +6 -0
M sudoku/Gamemode.go +6 -0
M takuzu/Gamemode.go +6 -0
M wordsearch/Gamemode.go +5 -0