clear screen before rendering

This commit is contained in:
Crispy 2023-07-21 16:39:03 +02:00
parent d22ed686e3
commit 7ae61d8ca7

View file

@ -5,9 +5,10 @@ use region::Region;
fn main() { fn main() {
let mut region = Region::new(1, 1); let mut region = Region::new(1, 1);
region.randomise(); region.randomise();
print!("\x1B[2J"); // clear screen
loop { loop {
println!("####################"); print!("\x1B[u"); // reset cursor
region.print_all(true); region.print_all(true);
region.step(); region.step();
region.auto_grow(); region.auto_grow();