generator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSolvedBoard

func GenerateSolvedBoard(options SudokuGeneratorOptions) core.SudokuBoard

Function to generate a solved Sudoku board by solving an empty board randomly.

func GenerateSudokuProblem

func GenerateSudokuProblem(options SudokuGeneratorOptions) core.SudokuBoard

Function to generate a Sudoku problem.

func GenerateSudokuProblemFromSolvedBoard

func GenerateSudokuProblemFromSolvedBoard(board core.SudokuBoard, options SudokuGeneratorOptions) core.SudokuBoard

Function to generate a Sudoku problem from a solved board.

func GenerateSudokuProblemFromString

func GenerateSudokuProblemFromString(input string) (boardPointer *core.SudokuBoard, err error)

Function to generate a Sudoku problem from an input string.

Types

type SudokuDifficulty

type SudokuDifficulty struct {
	MinimumClues       int      // Inclusive.
	MaximumClues       int      // Exclusive.
	StrategySolverKeys []string // Allowed strategies to solve the problem.
}

Define the difficulty levels of a Sudoku problem.

func NewCustomSudokuDifficulty

func NewCustomSudokuDifficulty(minimumClues int, maximumClues int, solverKeys []string) SudokuDifficulty

Constructor like function to create the custom difficulty level.

func NewEasySudokuDifficulty

func NewEasySudokuDifficulty() SudokuDifficulty

Constructor like function to create the easy difficulty level.

func NewEvilSudokuDifficulty

func NewEvilSudokuDifficulty() SudokuDifficulty

Constructor like function to create the evil difficulty level.

func NewExtremeSudokuDifficulty

func NewExtremeSudokuDifficulty() SudokuDifficulty

Constructor like function to create the extreme difficulty level.

func NewHardSudokuDifficulty

func NewHardSudokuDifficulty() SudokuDifficulty

Constructor like function to create the hard difficulty level.

func NewMediumSudokuDifficulty

func NewMediumSudokuDifficulty() SudokuDifficulty

Constructor like function to create the medium difficulty level.

func (SudokuDifficulty) IsWithinDifficultyLevel

func (difficulty SudokuDifficulty) IsWithinDifficultyLevel(numberOfClues int) bool

Function to check if the number of clues is within the difficulty level.

type SudokuGeneratorOptions

type SudokuGeneratorOptions struct {
	// Public fields.
	MaximumSolutions  int
	MaximumIterations int
	Difficulty        SudokuDifficulty
	// contains filtered or unexported fields
}

Define the options to generate a Sudoku problem.

func NewSudokuProblemOptions

func NewSudokuProblemOptions(solverStore solver.SudokuSolverStore, difficulty SudokuDifficulty) SudokuGeneratorOptions

Constructor like function to create a default options object.

Jump to

Keyboard shortcuts

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