From 6f599f12f64a51cfd2bc039a5ad48d5f9d8ef9d9 Mon Sep 17 00:00:00 2001 From: Alex Kapranoff Date: Tue, 4 Jan 2022 00:47:34 -0800 Subject: [PATCH] Fix the bug identified in #400 --- 02_Amazing/perl/amazing.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/02_Amazing/perl/amazing.pl b/02_Amazing/perl/amazing.pl index a474ba59..c7cb5f44 100644 --- a/02_Amazing/perl/amazing.pl +++ b/02_Amazing/perl/amazing.pl @@ -60,6 +60,10 @@ while (keys %is_visited < $width * $height) { } } +unless ($path_found) { + $walls[-1]->[rand $width] |= 1; +} + print_maze(); sub input_dimensions {