pub struct OnlyCellStrategy;
Expand description
A Strategy which detects situations in which a digit can only go in one cell of a group.
As a visualization, the cell marked with X in the following example is the only one in its block that can be a 2 (using classic Sudoku rules).
╔═══╤═══╦═══╤═══╗
║ │ ║ │ 2 ║
╟───┼───╫───┼───╢
║ X │ 1 ║ │ ║
╠═══╪═══╬═══╪═══╣
║ │ ║ │ ║
╟───┼───╫───┼───╢
║ │ ║ │ ║
╚═══╧═══╩═══╧═══╝
Trait Implementations§
Source§impl Clone for OnlyCellStrategy
impl Clone for OnlyCellStrategy
Source§fn clone(&self) -> OnlyCellStrategy
fn clone(&self) -> OnlyCellStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Strategy for OnlyCellStrategy
impl Strategy for OnlyCellStrategy
Source§fn apply(&self, sudoku_info: &mut SudokuInfo<impl Constraint + Clone>) -> bool
fn apply(&self, sudoku_info: &mut SudokuInfo<impl Constraint + Clone>) -> bool
Applies this strategy to the given Sudoku. The strategy may rely on and
modify the information in the given
sudoku_info
. This instance is
given to other strategies that participate in the solution and/or
future iterations of the same strategy. It can thus be used to
communicate insights. Read moreAuto Trait Implementations§
impl Freeze for OnlyCellStrategy
impl RefUnwindSafe for OnlyCellStrategy
impl Send for OnlyCellStrategy
impl Sync for OnlyCellStrategy
impl Unpin for OnlyCellStrategy
impl UnwindSafe for OnlyCellStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more