Struct sudoku_rust::SudokuBoard
source · Fields
cells: [[Cell; 9]; 9]
Implementations
sourceimpl SudokuBoard
impl SudokuBoard
sourcepub fn unused_in_box(
grid: [[Cell; 9]; 9],
row_start: usize,
col_start: usize,
num: u8
) -> bool
pub fn unused_in_box(
grid: [[Cell; 9]; 9],
row_start: usize,
col_start: usize,
num: u8
) -> bool
Returns false if given SRN x SRN block contains num.
sourcepub fn check_if_safe(grid: [[Cell; 9]; 9], i: usize, j: usize, num: u8) -> bool
pub fn check_if_safe(grid: [[Cell; 9]; 9], i: usize, j: usize, num: u8) -> bool
Check if safe to put in cell
pub fn unused_in_row(grid: [[Cell; 9]; 9], i: usize, num: u8) -> bool
pub fn unused_in_col(grid: [[Cell; 9]; 9], j: usize, num: u8) -> bool
sourcepub fn fill_remaining(&mut self, i: usize, j: usize) -> bool
pub fn fill_remaining(&mut self, i: usize, j: usize) -> bool
A recursive function to fill remaining matrix
sourcepub fn solve(grid: [[Cell; 9]; 9], counter: u32) -> u32
pub fn solve(grid: [[Cell; 9]; 9], counter: u32) -> u32
Get the amount of unique solutions a board has
sourcepub fn remove_cells(&mut self, attempts: u32)
pub fn remove_cells(&mut self, attempts: u32)
Remove cells from the filled solved board to make a puzzle
sourcepub fn display_grid(grid: &[[Cell; 9]; 9])
pub fn display_grid(grid: &[[Cell; 9]; 9])
Display grid in stdout
Auto Trait Implementations
impl RefUnwindSafe for SudokuBoard
impl Send for SudokuBoard
impl Sync for SudokuBoard
impl Unpin for SudokuBoard
impl UnwindSafe for SudokuBoard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more