Enum sudoku::Group
[−]
[src]
pub enum Group { Box(Vec<Option<Element>>), Stack(Vec<Option<Element>>), Band(Vec<Option<Element>>), }
A subdivision of the main sudoku; the smallest grouping to which rules are applied.
Variants
Box(Vec<Option<Element>>)
A square set of elements.
A subdivision of a sudoku.
Rule
Each box may contain each element value only once.
Stack(Vec<Option<Element>>)
A vertical set of elements.
A subdivision of a sudoku.
Rule
Each stack may contain each element value only once.
Band(Vec<Option<Element>>)
A horizontal set of elements.
A subdivision of a sudoku.
Rule
Each band may contain each element value only once.
Dimensionality
In n dimensions, n - 1
bands apply to each element.
Each is linearly independent from the others and from the relevant stack.
Methods
impl Group
[src]
pub fn is_valid(&self) -> bool
[src]
Whether a group is valid (contains no errors).
A group is considered valid if it contains only unique elements (ignoring empty elements).
pub fn is_complete(&self) -> bool
[src]
Whether a group is complete.
A group is considered complete if it contains every possible element value exactly once.
pub fn elements(&self) -> Vec<Option<Element>>
[src]
Returns an owned copy of the group's constituent elements.
Trait Implementations
impl Clone for Group
[src]
fn clone(&self) -> Group
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Group
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more