Documentation
¶
Overview ¶
Package takuzu implements the binary (Binairo) puzzle game.
Index ¶
- Variables
- func New(mode TakuzuMode, puzzle grid, provided [][]bool) (game.Gamer, error)
- type KeyMap
- type Model
- func (m Model) GetDebugInfo() string
- func (m Model) GetFullHelp() [][]key.Binding
- func (m Model) GetSave() ([]byte, error)
- func (m Model) Init() tea.Cmd
- func (m Model) IsSolved() bool
- func (m Model) Reset() game.Gamer
- func (m Model) SetTitle(t string) game.Gamer
- func (m Model) Update(msg tea.Msg) (game.Gamer, tea.Cmd)
- func (m Model) View() string
- type Save
- type TakuzuMode
Constants ¶
This section is empty.
Variables ¶
View Source
var DailyModes = []list.Item{ Modes[2], Modes[3], }
View Source
var DefaultKeyMap = KeyMap{ CursorKeyMap: game.DefaultCursorKeyMap, PlaceZero: key.NewBinding( key.WithKeys("z", "0"), key.WithHelp("z/0", "Place ●"), ), PlaceOne: key.NewBinding( key.WithKeys("x", "1"), key.WithHelp("x/1", "Place ○"), ), Clear: key.NewBinding( key.WithKeys("backspace", "delete"), key.WithHelp("bkspc", "Clear"), ), }
View Source
var Definition = game.Definition{ Name: "Takuzu", Description: "Fill the grid with ● and ○.", Aliases: []string{"binairo", "binary"}, Modes: Modes, DailyModes: DailyModes, Help: HelpContent, Import: func(data []byte) (game.Gamer, error) { return ImportModel(data) }, }
View Source
var HelpContent string
View Source
var Modes = []list.Item{ NewMode("Beginner", "6×6 grid, ~50% clues. Doubles and sandwich patterns.", 6, 0.50), NewMode("Easy", "6×6 grid, ~40% clues. Counting required.", 6, 0.40), NewMode("Medium", "8×8 grid, ~40% clues. Larger grid, moderate deduction.", 8, 0.40), NewMode("Tricky", "10×10 grid, ~38% clues. Uniqueness rule needed.", 10, 0.38), NewMode("Hard", "10×10 grid, ~32% clues. Long deduction chains.", 10, 0.32), NewMode("Very Hard", "12×12 grid, ~30% clues. Deep logic required.", 12, 0.30), NewMode("Extreme", "14×14 grid, ~28% clues. Maximum challenge.", 14, 0.28), }
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model implements game.Gamer for Takuzu.
func ImportModel ¶
ImportModel reconstructs a Model from saved JSON data.
func (Model) GetDebugInfo ¶
func (Model) GetFullHelp ¶
type Save ¶
type Save struct {
Size int `json:"size"`
State string `json:"state"`
Provided string `json:"provided"`
ModeTitle string `json:"mode_title"`
}
Save represents the serialized state of a Takuzu game.
type TakuzuMode ¶
func (TakuzuMode) SpawnSeeded ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.
