Struct sudoku::Sudoku
[−]
[src]
pub struct Sudoku { // some fields omitted }
The main structure exposing all the functionality of the library
Methods
impl Sudoku
[src]
fn from_str(s: &str) -> Result<Sudoku, ParseError>
Creates a new sudoku based on a &str
. See the crate documentation
for an example of the expected format
fn from_reader<T: BufRead>(reader: T) -> Result<Sudoku, ParseError>
Creates a new sudoku based on a reader. See the crate documentation for an example of the expected format
fn solve(&mut self)
Attempts to solve the sudoku
The fast_solve
method is attempted first, and brute_force_solve
is used as a fallback in case the sudoku is still unsolved
fn fast_solve(&mut self)
Attempts to solve the sudoku without brute forcing it
This doesn't always succeed. You can use the is_solved
method
to check if the sudoku was successfuly solved
fn brute_force_solve(&mut self)
Attempts to solve the sudoku by brute forcing it
The numbers that have already been found are not changed
fn is_solved(&self) -> bool
Returns true if the sudoku is solved
Trait Implementations
impl PartialEq for Sudoku
[src]
fn eq(&self, __arg_0: &Sudoku) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Sudoku) -> bool
This method tests for !=
.
impl Eq for Sudoku
[src]
impl Debug for Sudoku
[src]
impl Clone for Sudoku
[src]
fn clone(&self) -> Sudoku
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more