fixed ask error

This commit is contained in:
WanderingPenwing 2024-12-03 17:51:28 +01:00
parent cdc66c4793
commit 604837f74c

View file

@ -280,13 +280,6 @@ impl Sudoku {
} }
fn remove_allowed(&mut self, row_index: usize, column_index: usize, blocking_cells: &Vec<cell::BlockingCell>) -> Result<(), WaveError> { fn remove_allowed(&mut self, row_index: usize, column_index: usize, blocking_cells: &Vec<cell::BlockingCell>) -> Result<(), WaveError> {
if let Some(state) = self.grid[row_index][column_index].get_state() {
for blocking_cell in blocking_cells {
if blocking_cell.state == state {
return Err(WaveError::Contradiction)
}
}
}
match self.grid[row_index][column_index].remove_allowed(blocking_cells) { match self.grid[row_index][column_index].remove_allowed(blocking_cells) {
Ok(result) => { Ok(result) => {
let cell::RemoveResult::Collapsed(state) = result else { let cell::RemoveResult::Collapsed(state) = result else {
@ -407,7 +400,6 @@ impl Sudoku {
} }
} }
println!(); println!();
if self.debug_display { if self.debug_display {
println!("--------"); println!("--------");
} }