[][src]Trait nonogrid::block::base::Color

pub trait Color where
    Self: Debug + PartialEq + Eq + Hash + Default + Copy + Clone + Send + Sync + PartialOrd + Ord + Add<Output = Self> + Sub<Output = Result<Self, String>>, 
{ fn blank() -> Self;
fn is_solved(&self) -> bool;
fn solution_rate(&self, all_colors: &[ColorId]) -> f64;
fn is_updated_with(&self, new: &Self) -> Result<bool, String>;
fn variants(&self) -> Vec<Self>
    where
        Self: Sized
;
fn as_color_id(&self) -> Option<ColorId>;
fn from_color_ids(ids: &[ColorId]) -> Self; fn memoize_rate() -> bool { ... } }

Required methods

fn blank() -> Self

fn is_solved(&self) -> bool

fn solution_rate(&self, all_colors: &[ColorId]) -> f64

fn is_updated_with(&self, new: &Self) -> Result<bool, String>

fn variants(&self) -> Vec<Self> where
    Self: Sized

fn as_color_id(&self) -> Option<ColorId>

fn from_color_ids(ids: &[ColorId]) -> Self

Loading content...

Provided methods

Loading content...

Implementors

impl Color for BinaryColor[src]

fn memoize_rate() -> bool[src]

impl Color for MultiColor[src]

fn solution_rate(&self, all_colors: &[ColorId]) -> f64[src]

Calculate the rate of the given cell. The formula is like that: rate = (N - n) / (N - 1), where N = full puzzle color set n = current color set for given cell,

in particular: a) when the cell is completely unsolved rate = (N - N) / (N - 1) = 0 b) when the cell is solved rate = (N - 1) / (N - 1) = 1

Loading content...