grid progress display

This commit is contained in:
WanderingPenwing 2024-12-03 17:47:23 +01:00
parent 847f918ef9
commit cdc66c4793

View file

@ -378,6 +378,15 @@ impl Sudoku {
} }
if self.grid_display { if self.grid_display {
if !self.debug_display {
let height = self.size + self.square_size + 2;
print!("\x1b[{}A", height);
for _ in 0..height {
println!("{}"," ".repeat((self.size + self.square_size - 1)*2 + 5));
}
println!();
print!("\x1b[{}A", height);
}
self.display(ui::DisplayMode::Full); self.display(ui::DisplayMode::Full);
} }
@ -404,7 +413,9 @@ impl Sudoku {
} }
let elapsed = now.elapsed(); let elapsed = now.elapsed();
println!("# finished in {} propagations ({} forced collapse), {:.2?} ({:.2?}/propagation)", propagation_counter, collapse_counter, elapsed, elapsed/(propagation_counter as u32)); println!("# finished in {} propagations ({} forced collapse), {:.2?} ({:.2?}/propagation)", propagation_counter, collapse_counter, elapsed, elapsed/(propagation_counter as u32));
if !self.grid_display || self.debug_display {
self.display(ui::DisplayMode::Full); self.display(ui::DisplayMode::Full);
}
Ok(()) Ok(())
} }