algorithms

package
v0.0.0-...-45e99ae Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSudokuCannotBeSolved is thrown when a sudoku cannot be solved
	ErrSudokuCannotBeSolved = stacktrace.NewError("sudoku cannot be solved")
)

Functions

This section is empty.

Types

type SudokuSolver

type SudokuSolver struct {
}

SudokuSolver solves a sudoku using backtracking

func (SudokuSolver) IsBoardValid

func (sudoku SudokuSolver) IsBoardValid(board [9][9]int) bool

IsBoardValid checks if a sudoku board is valid

func (SudokuSolver) PrintBoard

func (sudoku SudokuSolver) PrintBoard(board [9][9]int)

PrintBoard prints a sudoku board

func (SudokuSolver) Solve

func (sudoku SudokuSolver) Solve(board [9][9]int) (result [9][9]int, err error)

Solve solves a sudoku

Jump to

Keyboard shortcuts

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