Documentation
¶
Overview ¶
Package lightsout implements the lights out toggle puzzle game.
Index ¶
- Variables
- func Generate(w, h int) [][]bool
- func GenerateSeeded(w, h int, rng *rand.Rand) [][]bool
- func IsSolved(grid [][]bool) bool
- func Toggle(grid [][]bool, x, y int)
- type KeyMap
- type Mode
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultKeyMap = KeyMap{ CursorKeyMap: game.DefaultCursorKeyMap, Toggle: key.NewBinding( key.WithKeys("enter", "space"), key.WithHelp("enter/space", "Toggle"), ), }
View Source
var Definition = puzzle.NewDefinition(puzzle.DefinitionSpec{ Name: "Lights Out", Description: "Turn the lights off.", Aliases: []string{"lights"}, Modes: ModeDefinitions, DailyModeIDs: puzzle.SelectModeIDsByIndex(ModeDefinitions, 1, 2), })
View Source
var Entry = gameentry.NewEntry(gameentry.EntrySpec{ Definition: Definition, Help: HelpContent, Import: game.AdaptImport(ImportModel), Modes: Modes, })
View Source
var HelpContent string
View Source
var ModeDefinitions = gameentry.BuildModeDefs(Modes)
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func ImportModel ¶
func (Model) GetDebugInfo ¶
func (Model) GetFullHelp ¶
Click to show internal directories.
Click to hide internal directories.
