- commit
- c9705e5c2f3c1126a93e8b9bbaecf7bffc9b2b39
- parent
- 50495ad15465aa27199b6e671c2c3ba9f76b20ce
- author
- Dami <dami.etoile@gmail.com>
| M | daily.go | 48 | +++++++++++++++++++++--------- |
| M | hashiwokakero/ | 6 | ++++ |
| M | hitori/ | 6 | ++++ |
| M | lightsout/ | 6 | ++++ |
| M | nonogram/ | 6 | ++++ |
| M | sudoku/ | 6 | ++++ |
| M | takuzu/ | 6 | ++++ |
| M | wordsearch/ | 5 | +++ |
@@ -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.@@ -68,3 +68,9 @@ var Modes = []list.Item{
6868 NewMode("Medium 13x13", "13x13 grid with 42-51 islands.", 13, 13, 42, 51),6969 NewMode("Hard 13x13", "13x13 grid with 59-68 islands.", 13, 13, 59, 68),7070 }71+72+// DailyModes is the subset of Modes eligible for daily puzzle rotation.73+var DailyModes = []list.Item{74+ Modes[3], // Easy 9x975+ Modes[1], // Medium 7x776+}@@ -64,3 +64,9 @@ var Modes = []list.Item{
6464 NewMode("Hard", "10\u00d710 grid, advanced logic chains.", 10, 0.30),6565 NewMode("Expert", "12\u00d712 grid, maximum challenge.", 12, 0.28),6666 }67+68+// DailyModes is the subset of Modes eligible for daily puzzle rotation.69+var DailyModes = []list.Item{70+ Modes[1], // Easy 6x671+ Modes[2], // Medium 8x872+}@@ -60,3 +60,9 @@ var Modes = []list.Item{
6060 NewMode("Epic", "20x20 grid, ~71% filled. A epic undertaking.", 20, 20, 0.71),6161 NewMode("Massive", "20x20 grid, ~56% filled. Truly massive puzzle.", 20, 20, 0.56),6262 }63+64+// DailyModes is the subset of Modes eligible for daily puzzle rotation.65+var DailyModes = []list.Item{66+ Modes[3], // Standard 10x1067+ Modes[4], // Classic 10x1068+}@@ -47,3 +47,9 @@ var Modes = []list.Item{
4747 NewMode("Expert", "22–26 clues. X-Wing / Y-Wing.", 22),4848 NewMode("Diabolical", "17–21 clues. Swordfish / XY-Chains.", 17),4949 }50+51+// DailyModes is the subset of Modes eligible for daily puzzle rotation.52+var DailyModes = []list.Item{53+ Modes[1], // Easy54+ Modes[2], // Medium55+}@@ -62,3 +62,9 @@ var Modes = []list.Item{
6262 NewMode("Very Hard", "12×12 grid, ~30% clues. Deep logic required.", 12, 0.30),6363 NewMode("Extreme", "14×14 grid, ~28% clues. Maximum challenge.", 14, 0.28),6464 }65+66+// DailyModes is the subset of Modes eligible for daily puzzle rotation.67+var DailyModes = []list.Item{68+ Modes[2], // Medium 8x869+ Modes[3], // Tricky 10x1070+}@@ -58,3 +58,8 @@ var Modes = []list.Item{
5858 NewMode("Medium 15x15", "Find 10 words in a 15x15 grid.", 15, 15, 10, 4, 7, []Direction{Right, Down, DownRight, DownLeft, Left, Up}),5959 NewMode("Hard 20x20", "Find 15 words in a 20x20 grid.", 20, 20, 15, 5, 10, []Direction{Right, Down, DownRight, DownLeft, Left, Up, UpRight, UpLeft}),6060 }61+62+// DailyModes is the subset of Modes eligible for daily puzzle rotation.63+var DailyModes = []list.Item{64+ Modes[0], // Easy 10x1065+}