Documentation
¶
Overview ¶
Package sudoku implements the classic number-placement puzzle.
Index ¶
- Variables
- func GenerateProvidedCells(m SudokuMode) []cell
- func New(mode SudokuMode, provided []cell) (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) IsProvidedCell() bool
- 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 Save
- type SudokuMode
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultKeyMap = KeyMap{ CursorKeyMap: game.DefaultCursorKeyMap, FillValue: key.NewBinding( key.WithKeys("1", "2", "3", "4", "5", "6", "7", "8", "9"), key.WithHelp("[1-9]", "Fill Cell"), ), ClearCell: key.NewBinding( key.WithKeys("backspace"), key.WithHelp("bkspc", "Clear Cell Contents"), ), }
View Source
var Modes = []list.Item{ NewMode("Beginner", "45–52 clues. Single Candidate / Scanning.", 45), NewMode("Easy", "38–44 clues. Naked Singles.", 38), NewMode("Medium", "32–37 clues. Hidden Pairs / Pointing.", 32), NewMode("Hard", "27–31 clues. Box-Line Reduction / Triples.", 27), NewMode("Expert", "22–26 clues. X-Wing / Y-Wing.", 22), NewMode("Diabolical", "17–21 clues. Swordfish / XY-Chains.", 17), }
Functions ¶
func GenerateProvidedCells ¶
func GenerateProvidedCells(m SudokuMode) []cell
GenerateProvidedCells generates a random sudoku puzzle with the number of provided cells determined by the mode's ProvidedCount.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func ImportModel ¶
func (Model) GetDebugInfo ¶
GetDebugInfo implements game.Gamer.
func (Model) GetFullHelp ¶
GetFullHelp implements game.Gamer.
func (Model) IsProvidedCell ¶
Click to show internal directories.
Click to hide internal directories.