pub struct Nonogram { /* private fields */ }Expand description
Represents a Nonogram puzzle, including its constraints and solution.
Implementations§
Source§impl Nonogram
impl Nonogram
Sourcepub fn new(rows: Vec<Vec<u32>>, cols: Vec<Vec<u32>>) -> Self
pub fn new(rows: Vec<Vec<u32>>, cols: Vec<Vec<u32>>) -> Self
Creates a new Nonogram instance with the given row and column constraints.
Sourcepub fn decode(&self, assignment: &Solutions) -> Vec<Vec<Cell>>
pub fn decode(&self, assignment: &Solutions) -> Vec<Vec<Cell>>
decodes a given assignment of variables into a solution grid.
Sourcepub fn to_cnf<L: Literal, S: LiteralStorage<L>>(&self) -> Cnf<L, S>
pub fn to_cnf<L: Literal, S: LiteralStorage<L>>(&self) -> Cnf<L, S>
Converts the Nonogram into a CNF (Conjunctive Normal Form) representation suitable for SAT solving.
Trait Implementations§
impl Eq for Nonogram
impl StructuralPartialEq for Nonogram
Auto Trait Implementations§
impl Freeze for Nonogram
impl RefUnwindSafe for Nonogram
impl Send for Nonogram
impl Sync for Nonogram
impl Unpin for Nonogram
impl UnwindSafe for Nonogram
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more