Trait sudoku_variants::solver::strategy::Strategy[][src]

pub trait Strategy {
    fn apply(
        &self,
        sudoku_info: &mut SudokuInfo<impl Constraint + Clone>
    ) -> bool; }

A trait for strategies, which use logical reasoning to restrict the possibilities of a Sudoku.

Required methods

fn apply(&self, sudoku_info: &mut SudokuInfo<impl Constraint + Clone>) -> bool[src]

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.

This method shall return true if and only if something has changed, that is, a digit has been entered or an option has been removed.

Loading content...

Implementors

impl Strategy for NakedSingleStrategy[src]

impl Strategy for NoStrategy[src]

impl Strategy for OnlyCellStrategy[src]

impl<F: Fn(usize) -> usize> Strategy for TupleStrategy<F>[src]

impl<FC, FA, S> Strategy for BoundedCellsBacktrackingStrategy<FC, FA, S> where
    FC: Fn(usize) -> usize,
    FA: Fn(usize) -> Option<usize>,
    S: Strategy
[src]

impl<FO, FA, S> Strategy for BoundedOptionsBacktrackingStrategy<FO, FA, S> where
    FO: Fn(usize) -> usize,
    FA: Fn(usize) -> Option<usize>,
    S: Strategy
[src]

impl<S1: Strategy, S2: Strategy> Strategy for CompositeStrategy<S1, S2>[src]

Loading content...