sudoku

package
v0.0.0-...-084f03b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board interface {
	Get(int, int) Cell
	GameOver() bool
	Fix()
	String() string
	Clone() Board
	// contains filtered or unexported methods
}

func LoadBoard

func LoadBoard(s string) (Board, error)

func NewBoard

func NewBoard() Board

type Cell

type Cell interface {
	Value() int
	IsSet() bool
	Set(int) bool
	Reset()
	Candidate(int) bool
	Candidates() int
	Enable(int) bool
	Disable(int) bool
	Toggle(int) bool
	Clone() Cell
	String() string
	Debug() string
	// contains filtered or unexported methods
}

func NewCell

func NewCell(value int) Cell

type Game

type Game interface {
	Autofill()
	GameOver() bool
	Get(int, int) Cell
	Set(int, int, int) bool
	Toggle(int, int, int) bool
	Undo() bool
	Redo() bool
	String() string
}

func NewGame

func NewGame(input interface{}) (Game, error)

type GeneratorType

type GeneratorType struct {
	Generate    func(Board, Level)
	HideCells   func(Board, Level)
	SwapDigits  func(Board)
	SwapRows    func(Board)
	SwapColumns func(Board)
}
var Generator GeneratorType

type Level

type Level uint16
const (
	EXTREMELY_EASY Level = Level((25 << 8) | 31)
	EASY           Level = Level((32 << 8) | 44)
	MEDIUM         Level = Level((45 << 8) | 49)
	HARD           Level = Level((50 << 8) | 53)
	FIENDISH       Level = Level((54 << 8) | 59)
)

func (Level) Exec

func (level Level) Exec(callback func() bool)

func (Level) Max

func (level Level) Max() int

func (Level) Min

func (level Level) Min() int

func (Level) String

func (level Level) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL