Skip to main content

Module core

Module core 

Source
Expand description

Core module for the Rustoku solver and generator.

This module includes the Rustoku struct for representing and solving Sudoku puzzles using backtracking and Minimum Remaining Values (MRV). It provides functionality for solving puzzles and checking solutions.

This module also includes a function to generate new Sudoku puzzles with a specified number of clues, ensuring that the generated puzzle has a unique solution.

Structs§

Board
Raw 9x9 board with some useful helpers.
BoardGenerator
A builder for generating Sudoku puzzles with various constraints and properties.
Candidates
Represents the candidates cache for a Rustoku puzzle.
Masks
Masks for Rustoku puzzle, representing the state of rows, columns, and boxes.
Rustoku
Solver primitive that uses backtracking and bitmasking for constraints.
RustokuBuilder
A simple builder for constructing Rustoku with fluent configuration.
Solution
Solved board and its solution path.
Solutions
Lazy iterator wrapper for solutions. Uses an explicit DFS stack and yields solutions one-by-one without computing them all up-front.
SolvePath
Solve path associated with a solution.
TechniqueFlags
Bitflags indicating which human techniques are active/enabled.

Enums§

Difficulty
SolveStep
Single step in the solving process.
Symmetry
Represents the type of symmetry to apply during board generation.

Functions§

generate_board
Generates a new Sudoku puzzle with a unique solution and specified symmetry.
generate_board_by_difficulty
Generates a new Sudoku puzzle that matches a specific difficulty level.