Cover an edge case

[probably very rare, but still]
pull/1302/head
The Dod 2022-01-15 15:19:57 +02:00
parent d61d3e2cea
commit 4ae37809d0
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ function Maze(n) {
from_group = to_group = -1;
while (from_group<0) {
let trying_down = false;
if (Math.random()<0.5 || !candidates_right.length) {
if (Math.random()<0.5 && candidates_down.length || !candidates_right.length) {
trying_down = true;
}
let candidates = trying_down ? candidates_down : candidates_right;