sudoku_test

package
v0.0.0-...-b99e8af Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryLookup1to9

func BinaryLookup1to9(i uint16) (uint16, error)

func BitmapToDecimal

func BitmapToDecimal(bm uint16) int

func DecimalToBitmap

func DecimalToBitmap(i uint16) uint16

func IntToBinaryString

func IntToBinaryString(i uint16) string

func RemoveIntElement

func RemoveIntElement(s []int, element int) []int

func VerbosePrint

func VerbosePrint(verbose bool, message string)

Types

type SudokuBoard

type SudokuBoard struct {
	Name string     `json:"name"`
	Grid [81]uint16 `json:"grid"`

	// 54,55,56 57,58,59 60,61,62
	// 63,64,65 66,67,68 69,70,71
	// 72,73,74 75,76,77 78,79,80
	Neighborhood [][]int
	Verbose      bool
	Summary      struct {
		Steps       int `json:"steps"`
		SolvedStart int `json:"solved_start"`
		SolvedEnd   int `json:"solved_end"`
	}
}

func CreateSudokuBoard

func CreateSudokuBoard(ba []byte) (SudokuBoard, error)

func (*SudokuBoard) LeetOut

func (sb *SudokuBoard) LeetOut() [][]string

func (*SudokuBoard) PoplateNeighborhood

func (sb *SudokuBoard) PoplateNeighborhood()

func (*SudokuBoard) PrintBoard

func (sb *SudokuBoard) PrintBoard()

Displays the grid with uint16 values

func (*SudokuBoard) PrintDecimal

func (sb *SudokuBoard) PrintDecimal()

Displays the roman numerals 1-9, or 0

func (*SudokuBoard) Solve

func (sb *SudokuBoard) Solve() (final SudokuBoard)

func (*SudokuBoard) SolvedCnt

func (sb *SudokuBoard) SolvedCnt() (cnt int)

func (*SudokuBoard) SweepMark

func (sb *SudokuBoard) SweepMark() SudokuBoard

Jump to

Keyboard shortcuts

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