[−][src]Struct msolve::Sudoku
Structure that represents a sudoku
Implementations
impl Sudoku
[src]
pub fn to_array(&self) -> [u8; 81]
[src]
Convert the sudoku into a [u8; 81] containing the numerical form of each solved square
pub fn iter(self) -> SolutionIterator
[src]
Returns an iterator over all solutions
pub fn solve(self) -> Option<Self>
[src]
Get the first solution.
pub fn solve_unique(self) -> Option<Self>
[src]
Returns the first solution if it is uniquely solvable, otherwise returns None
pub fn count_solutions(self, n: usize) -> usize
[src]
Counts the number of solutions, up to maximum of n
pub fn has_single_solution(self) -> bool
[src]
Check whether the sudoku has exactly one solution without returning the solution
pub const fn empty() -> Self
[src]
Returns an empty sudoku grid, alternative to Sudoku::from([0; 81]) or Sudoku::from(vec![])
pub fn solve_difficulty(self) -> usize
[src]
Returns the number of steps to find the first solution, approximately proportional to difficulty
pub fn solve_unique_difficulty(self) -> usize
[src]
Returns the number of steps to find the first two solutions, approximately proportional to difficulty
Trait Implementations
impl Clone for Sudoku
[src]
impl Copy for Sudoku
[src]
impl<'_, T: TryInto<usize> + Copy> From<&'_ [T; 81]> for Sudoku
[src]
impl<'_, T: TryInto<usize> + Copy> From<&'_ [T]> for Sudoku
[src]
impl<'_> From<&'_ String> for Sudoku
[src]
impl<'_, T: TryInto<usize> + Copy> From<&'_ Vec<T>> for Sudoku
[src]
impl<'_> From<&'_ str> for Sudoku
[src]
impl<T: TryInto<usize> + Copy> From<[T; 81]> for Sudoku
[src]
impl From<String> for Sudoku
[src]
impl<T: TryInto<usize> + Copy> From<Vec<T>> for Sudoku
[src]
Auto Trait Implementations
impl RefUnwindSafe for Sudoku
impl Send for Sudoku
impl Sync for Sudoku
impl Unpin for Sudoku
impl UnwindSafe for Sudoku
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,