Struct quickbacktrack::BackTrackSolver [] [src]

pub struct BackTrackSolver<T> where T: Puzzle {
    pub states: Vec<T>,
    pub choice: Vec<(T::Pos, Vec<T::Val>)>,
    pub settings: SolveSettings,
}

Solvees puzzles using back tracking.

Fields

states: Vec<T>

Stores the states.

choice: Vec<(T::Pos, Vec<T::Val>)>

Stores the choices for the states.

settings: SolveSettings

Search for simple solutions.

Methods

impl<T> BackTrackSolver<T> where T: Puzzle
[src]

fn new(puzzle: T, settings: SolveSettings) -> BackTrackSolver<T>

Creates a new solver.

fn solve<F>(self, f: F) -> Option<T> where F: FnMut(&T) -> Option<T::Pos>

Solves puzzle, using a closure to look for best position to set a value next.