Documentation
¶
Overview ¶
Package hitori implements the Hitori number puzzle game.
Index ¶
- Variables
- func Generate(size int, blackRatio float64) (grid, error)
- func GenerateSeeded(size int, blackRatio float64, rng *rand.Rand) (grid, error)
- func New(mode HitoriMode, numbers grid) (game.Gamer, error)
- type HitoriMode
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultKeyMap = KeyMap{ CursorKeyMap: game.DefaultCursorKeyMap, ShadeCell: key.NewBinding( key.WithKeys("x"), key.WithHelp("x", "Shade"), ), CircleCell: key.NewBinding( key.WithKeys("z"), key.WithHelp("z", "Circle"), ), ClearCell: key.NewBinding( key.WithKeys("backspace", "delete"), key.WithHelp("bkspc", "Clear"), ), }
View Source
var Definition = puzzle.NewDefinition(puzzle.DefinitionSpec{ Name: "Hitori", Description: "Shade the cells to eliminate duplicates.", 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, Print: PDFPrintAdapter, })
View Source
var HelpContent string
View Source
var ModeDefinitions = gameentry.BuildModeDefs(Modes)
View Source
var Modes = []game.Mode{ NewMode("Mini", "5\u00d75 grid, gentle introduction.", 5, 0.32), NewMode("Easy", "6\u00d76 grid, straightforward logic.", 6, 0.32), NewMode("Medium", "8\u00d78 grid, moderate challenge.", 8, 0.30), NewMode("Tricky", "9\u00d79 grid, requires careful deduction.", 9, 0.30), NewMode("Hard", "10\u00d710 grid, advanced logic chains.", 10, 0.30), NewMode("Expert", "12\u00d712 grid, maximum challenge.", 12, 0.28), }
View Source
var PDFPrintAdapter = printAdapter{}
Functions ¶
func Generate ¶
Generate creates a Hitori puzzle of the given size. Returns the puzzle numbers grid or an error if generation fails after all attempts.
func GenerateSeeded ¶
Types ¶
type HitoriMode ¶
func (HitoriMode) SpawnSeeded ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model implements game.Gamer for Hitori.
func ImportModel ¶
ImportModel reconstructs a Model from saved JSON data.
func (Model) GetDebugInfo ¶
func (Model) GetFullHelp ¶
Click to show internal directories.
Click to hide internal directories.
