grid progress display
This commit is contained in:
parent
847f918ef9
commit
cdc66c4793
11
src/main.rs
11
src/main.rs
|
@ -378,6 +378,15 @@ impl Sudoku {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -404,7 +413,9 @@ impl Sudoku {
|
|||
}
|
||||
let elapsed = now.elapsed();
|
||||
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);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue