Start drawing the maze immediately to avoid flicker.
This commit is contained in:
parent
759c9c4f8a
commit
793fc69e1e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user