Expand description
Offers a function to help you solve sudoku puzzles.
The solve
function takes a sudoku puzzle and returns a new board with
the solution, if there is one.
use sudokugen::board::Board;
let mut board: Board =
". . . | 4 . . | 8 7 .
4 . 3 | . . . | . . .
2 . . | . . 3 | . . 9
---------------------
. . 6 | 2 . . | . . 7
. . . | 9 . 6 | . . .
3 . 9 | . 8 . | . . .
---------------------
. . . | . . . | . 4 .
8 7 2 | 5 . . | . . .
. . . | 7 2 . | 6 . .
"
.parse()
.unwrap();
board.solve().unwrap();
assert_eq!(
board,
"695412873413879526287653419146235987728946135359187264561398742872564391934721658"
.parse()
.unwrap()
);
Modules
Provides a function and a utility struct to help you generate new puzzles.
The
generate
function takes the base size of the board (see Board::new
for
an explanation of base size) and returns a unique, minimal puzzle together with
the solution for that puzzle.Structs
An errror to reperesent that this board is not solvable in it’s current state