pub struct Possibility {
pub row: usize,
pub column: usize,
pub square: usize,
pub value: usize,
}Expand description
A position and value for a box inside of a Sudoku puzzle.
Fields§
§row: usizeThe row position of the box.
The values ranges from 0 to n - 1, where n is the length of the
Sudoku board.
column: usizeThe column position of the box.
The values ranges from 0 to n - 1, where n is the length of the
Sudoku board.
square: usizeThe index of the subgrid.
The values ranges from 0 to n - 1, where n is the length of the
Sudoku board. This field is redundant in identifying where the box is
inside of the Sudoku board, however it is necessary to speed up checking
which Constraints are satisfied by this Possibility.
value: usizeThe value present inside of the box.
The values ranges from 1 to n, where n is the length of the
Sudoku board.
Implementations§
Source§impl Possibility
impl Possibility
Sourcepub fn from_latin(latin: Possibility, box_side_length: usize) -> Self
pub fn from_latin(latin: Possibility, box_side_length: usize) -> Self
Convert a latin_square::Possibility to a sudoku::Possibility.
Sourcepub fn satisfied_constraints(self) -> impl Iterator<Item = Constraint>
pub fn satisfied_constraints(self) -> impl Iterator<Item = Constraint>
Return an iterator over the Constraints that are satisfied by this
Possibility.
Trait Implementations§
Source§impl Clone for Possibility
impl Clone for Possibility
Source§fn clone(&self) -> Possibility
fn clone(&self) -> Possibility
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more