numberlink

package
v0.0.0-...-9e3a658 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MoveType = map[string]int{
	"Left":  1,
	"Up":    2,
	"Right": 3,
	"Down":  4,
}
View Source
var SPACE_REGEX = regexp.MustCompile(`  +`)

Functions

This section is empty.

Types

type Board

type Board struct {
	Size  int
	Size2 int

	Row       int
	Column    int
	MaxValue  int
	TotalMove int

	Candidates []bool // lit
	Lookup     []int  // idx

	NumCandidates int
	// contains filtered or unexported fields
}

func New

func New(row, column, maxValue int) *Board

func NewFromArray

func NewFromArray(cells [][]int) *Board

func NewFromString

func NewFromString(input string) *Board

Parse newline and space separated sudoku problem 0 0 3 ... 9 0 0 ... 0 0 1 ... ...

func (*Board) Idx

func (b *Board) Idx(row, col int) int

Idx 0-indexed

func (*Board) Print

func (s *Board) Print(w io.Writer)

func (*Board) PrintOneLine

func (s *Board) PrintOneLine(w io.Writer)

func (*Board) ReplaceWithSingleRowString

func (b *Board) ReplaceWithSingleRowString(input string, skipCandidateElimination bool)

func (*Board) SetValue

func (b *Board) SetValue(row, col, val int)

func (*Board) SolveWithModel

func (b *Board) SolveWithModel(model []bool)

func (*Board) XLit

func (b *Board) XLit(row, col int, director string) int

XLit 1-indexed Cell candidate values

func (*Board) YLit

func (b *Board) YLit(row, col, val int) int

YLit 1-indexed Cell candidate values

Jump to

Keyboard shortcuts

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