[−][src]Struct nonogram::Nonogram
Fields
row_segments: Array1<Vec<usize>>
column_segments: Array1<Vec<usize>>
completed_grid: Array2<u8>
Methods
impl Nonogram
[src]
row_segments
and column_segments
are in the form of a
pub fn generate(width: usize, height: usize) -> Nonogram
[src]
Generates a random nonogram with the given dimensions.
The generated puzzle is not checked for solvability.
pub fn height(&self) -> usize
[src]
Provides the height of the puzzle.
pub fn width(&self) -> usize
[src]
Provides the width of the puzzle.
pub fn solvable(&self) -> bool
[src]
Determines whether or not the puzzle is solvable.
This method attempts to programmatically solve the puzzle. If it reaches a dead-end the method returns false. Otherwise it reaches the conclusion of the puzzle and returns true.
pub fn generate_checksum(&self) -> u64
[src]
Generates a checksum for quickly determining equivalence between puzzles of like dimensions.
This is not meant to check equivalence between all puzzles, only those with the same dimensions. This function is meant for cross-platform checks for equivalence in those situations.
pub fn as_json(&self) -> Result<String, JsonError>
[src]
Serializes the nonogram as json so that we don't need to use serde every time we need to use it
pub fn from_json(serialized: &str) -> Result<Nonogram, String>
[src]
Trait Implementations
impl PartialEq<Nonogram> for Nonogram
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Nonogram
[src]
impl Debug for Nonogram
[src]
impl Hash for Nonogram
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'de> Deserialize<'de> for Nonogram
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Serialize for Nonogram
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,