Start drawing the maze immediately to avoid flicker.

This commit is contained in:
Juergen Stuber 2018-11-28 18:24:51 +01:00
parent 759c9c4f8a
commit 793fc69e1e
1 changed files with 46 additions and 44 deletions

View File

@ -162,7 +162,9 @@ fn main() -> std::io::Result<()> {
add_move(&mut open, arg, mid, (-1, 0));
add_move(&mut open, arg, mid, (0, -1));
}
} else {
}
// draw maze
let work = arg.max(1);
let mut count = 0;
while !open.is_empty() && count < work {
@ -209,7 +211,7 @@ fn main() -> std::io::Result<()> {
count += 1;
}
}
if open.is_empty() {
board.set((1, 1), Square::Start);
board.set((x_maze_size - 2, y_maze_size - 2), Square::Finish);