app

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package app implements the root TUI model for PuzzleTea, including the Elm-architecture update/view loop, game spawning, and debug overlay.

Index

Constants

This section is empty.

Variables

View Source
var Categories = []game.Category{
	{Name: "Hashiwokakero", Desc: "Connect islands with bridges.", Modes: hashiwokakero.Modes, Help: hashiwokakero.HelpContent},
	{Name: "Hitori", Desc: "Shade cells to eliminate duplicates.", Modes: hitori.Modes, Help: hitori.HelpContent},
	{Name: "Lights Out", Desc: "Turn off all the lights.", Modes: lightsout.Modes, Help: lightsout.HelpContent},
	{Name: "Nonogram", Desc: "Fill cells to match row and column hints.", Modes: nonogram.Modes, Help: nonogram.HelpContent},
	{Name: "Nurikabe", Desc: "Build islands while keeping one connected sea.", Modes: nurikabe.Modes, Help: nurikabe.HelpContent},
	{Name: "Shikaku", Desc: "Divide the grid into rectangles.", Modes: shikaku.Modes, Help: shikaku.HelpContent},
	{Name: "Sudoku", Desc: "Fill the 9x9 grid following sudoku rules.", Modes: sudoku.Modes, Help: sudoku.HelpContent},
	{Name: "Takuzu", Desc: "Fill the grid with ● and ○.", Modes: takuzu.Modes, Help: takuzu.HelpContent},
	{Name: "Word Search", Desc: "Find hidden words in a letter grid.", Modes: wordsearch.Modes, Help: wordsearch.HelpContent},
}

Categories is the master typed registry of all puzzle types.

View Source
var GameCategories = categoriesAsItems(Categories)

GameCategories is the list.Item view of Categories for bubbles lists.

Functions

func GenerateUniqueName

func GenerateUniqueName(s *store.Store) string

GenerateUniqueName generates a unique adjective-noun name, retrying if needed.

func InitialModel

func InitialModel(s *store.Store, cfg *config.Config) model

InitialModel creates the root TUI model for the main menu.

func InitialModelWithGame

func InitialModelWithGame(s *store.Store, cfg *config.Config, g game.Gamer, activeGameID int64, completionSaved bool) model

InitialModelWithGame creates a model that starts directly in gameView, bypassing the menu. Used by CLI flags (--new, --continue).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL