[−][src]Struct sudoku_rs::board::Board
board struct
Methods
impl Board
[src]
pub fn new() -> Self
[src]
pub fn from_vec(vec: Vec<u8>) -> Self
[src]
gen board from vec the len of vec must be 81 0 for empty and 1..=9 for value
use sudoku_rs::board::Board; let b = Board::from_vec(vec![ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]);
pub fn unchecked_set(&mut self, x: usize, y: usize, val: u8)
[src]
set value in board but not check value will also set bitset
pub fn unchecked_get(&self, x: usize, y: usize) -> Option<u8>
[src]
get value
return a Option<u8>
pub fn set(&mut self, x: usize, y: usize, val: u8) -> Result<(), SuDoKuError>
[src]
set value
pub fn get(&self, x: usize, y: usize) -> Result<Option<u8>, SuDoKuError>
[src]
get value
pub fn is_empty(&self, x: usize, y: usize) -> bool
[src]
check a solt is empty of not
use sudoku_rs::board::Board; let mut b = Board::new(); b.set(1, 2, 3).unwrap(); assert!(b.is_empty(1, 1)); assert!(!b.is_empty(1, 2));
pub fn unset(&mut self, x: usize, y: usize)
[src]
clear a slot
pub fn avaliable_val(&self, x: usize, y: usize) -> Vec<u8>
[src]
get avaliable values for a slot
pub fn avaliable_count(&self, x: usize, y: usize) -> usize
[src]
get avaliable values count for a slot
pub fn is_win(&self) -> bool
[src]
check if a board is filled
Trait Implementations
impl Default for Board
[src]
impl Clone for Board
[src]
fn clone(&self) -> Board
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Board
[src]
impl FromStr for Board
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,