sudoku

package
v0.0.0-...-7ce53e0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sudoku

type Sudoku struct {
	Cell [][]int `json:"cell"`
}

Sudoku describes a sudoku puzzle object.

func NewSudokuFromPuzzleImage

func NewSudokuFromPuzzleImage(img *image.PuzzleImage, inf *classifier.Inference) (*Sudoku, error)

NewSudokuFromPuzzleImage will instantiate a new Sudoku object given a PuzzleImage object and a numocr classifier Inference object to decode the image.

func (*Sudoku) IsCompleted

func (sd *Sudoku) IsCompleted() bool

IsCompleted will check if all cells in the sudoku are filled in.

func (*Sudoku) IsValid

func (sd *Sudoku) IsValid() bool

IsValid validates if the sudoku is valid.

func (*Sudoku) Solve

func (sd *Sudoku) Solve() bool

Solve will use backtracking to provide a solution for the sudoku.

func (*Sudoku) String

func (sd *Sudoku) String() string

String will return a printable version of the Sudoku object.

Jump to

Keyboard shortcuts

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