Documentation
¶
Overview ¶
Package nonogram implements the grid-based picture logic puzzle.
Index ¶
- Variables
- func New(mode NonogramMode, hints Hints) (game.Gamer, error)
- type Hints
- type KeyMap
- type Model
- func (m Model) GetDebugInfo() string
- func (m Model) GetFullHelp() [][]key.Binding
- func (m Model) GetSave() ([]byte, error)
- func (m Model) GetTomography() Hints
- func (m Model) Init() tea.Cmd
- func (m Model) IsSolved() bool
- 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 NonogramMode
- type Save
- type TomographyDefinition
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultKeyMap = KeyMap{ CursorKeyMap: game.DefaultCursorKeyMap, FillTile: key.NewBinding( key.WithKeys("z"), key.WithHelp("z", "Fill"), ), MarkTile: key.NewBinding( key.WithKeys("x"), key.WithHelp("x", "Mark"), ), ClearTile: key.NewBinding( key.WithKeys("backspace"), key.WithHelp("⌫", "Clear"), ), }
View Source
var Modes = []list.Item{ NewMode("Easy - 5x5", "A random nonogram on a five by five board.", 5, 5), NewMode("Medium - 10x10", "A random nonogram on a ten by ten board.", 10, 10), NewMode("Hard - 15x15", "A random nonogram on a fifteen by fifteen board.", 15, 15), NewMode("Extra - 5x10", "A random nonogram on a five by ten board.", 5, 10), }
Functions ¶
Types ¶
type Hints ¶
type Hints struct {
// contains filtered or unexported fields
}
func GenerateRandomTomography ¶
func GenerateRandomTomography(mode NonogramMode) Hints
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func ImportModel ¶
func (Model) GetDebugInfo ¶
func (Model) GetFullHelp ¶
func (Model) GetTomography ¶
type NonogramMode ¶
func NewMode ¶
func NewMode(title, description string, Height, Width int) NonogramMode
type Save ¶
type Save struct {
Solved bool `json:"solved"`
State string `json:"state"`
Width int `json:"width"`
Height int `json:"height"`
RowHints TomographyDefinition `json:"row-hints"`
ColHints TomographyDefinition `json:"col-hints"`
}
type TomographyDefinition ¶
type TomographyDefinition [][]int
func (TomographyDefinition) RequiredLen ¶
func (t TomographyDefinition) RequiredLen() int
func (TomographyDefinition) String ¶
func (t TomographyDefinition) String() string
Click to show internal directories.
Click to hide internal directories.