pub struct SudokuBoard {
pub cells: [[Cell; 9]; 9],
}
Fields§
§cells: [[Cell; 9]; 9]
Implementations§
Source§impl 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 Freeze for SudokuBoard
impl RefUnwindSafe for SudokuBoard
impl Send for SudokuBoard
impl Sync for SudokuBoard
impl Unpin for SudokuBoard
impl UnwindSafe for SudokuBoard
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