Documentation
¶
Index ¶
- func GenerateSolvedBoard(options SudokuGeneratorOptions) core.SudokuBoard
- func GenerateSudokuProblem(options SudokuGeneratorOptions) core.SudokuBoard
- func GenerateSudokuProblemFromSolvedBoard(board core.SudokuBoard, options SudokuGeneratorOptions) core.SudokuBoard
- func GenerateSudokuProblemFromString(input string) (boardPointer *core.SudokuBoard, err error)
- type SudokuDifficulty
- func NewCustomSudokuDifficulty(minimumClues int, maximumClues int, solverKeys []string) SudokuDifficulty
- func NewEasySudokuDifficulty() SudokuDifficulty
- func NewEvilSudokuDifficulty() SudokuDifficulty
- func NewExtremeSudokuDifficulty() SudokuDifficulty
- func NewHardSudokuDifficulty() SudokuDifficulty
- func NewMediumSudokuDifficulty() SudokuDifficulty
- type SudokuGeneratorOptions
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.