Your skill will accomplishwhat the force of many cannot PerlMonks

### Comment on

 Need Help??
```#!perl
# labir.pl -- maze generator
# Copyright (C) Zsban Ambrus 2001--2009
use warnings; use strict; use 5.010;
my \$W = 35;
my \$H = 19;
my @a = ([(1)x(3+2*\$W)], map({ [1, (0)x(1+2*\$W), 1] } 1 .. 1+2*\$H), [(
+1)x(3+2*\$W)]);
for my \$u (0 .. \$H-1) {
for my \$v (0 .. \$W-1) {
\$a[2+2*\$u][2+2*\$v] = 1;
}
}
my @y = (-1)x(\$W*\$H);
my \$C; \$C = sub {
no warnings "recursion";
my(\$v) = @_;
my \$w = \$y[\$v];
if (\$w < 0) {
return \$v;
} else {
my \$z = &\$C(\$w);
\$y[\$v] = \$z;
return \$z;
}
};
my \$U = sub {
my(\$u, \$v) = @_;
my(\$c, \$d) = (&\$C(\$u), &\$C(\$v));
\$c != \$d and
\$y[\$c] = \$d;
};
while (&\$C(0) != &\$C(\$W*\$H-1)) {
my \$a = 1 < rand(2);
my \$x = int(rand(\$H));
my \$y = int(rand(\$W));
\$a ? \$y < \$W - 1 : \$x < \$H - 1 or next;
my (\$u, \$v) = ((\$x+!\$a)*\$W+(\$y+\$a), \$x*\$W+\$y);
&\$C(\$u) != &\$C(\$v) || rand(5) < 1 or next; # here's the magic
&\$U(\$u, \$v);
\$a[2+!\$a+2*\$x][2+\$a+2*\$y] = 1;
}
for my \$r (1 .. 1+2*\$H) {
for my \$c (1 .. 1+2*\$W) {
my \$o = \$a[\$r][\$c];
my \$v = \$a[\$r-1][\$c] && \$a[\$r+1][\$c];
my \$h = \$a[\$r][\$c-1] && \$a[\$r][\$c+1];
print(
2 == \$r && 2 == \$c ? "@" :
2*\$H == \$r && 1+2*\$W == \$c ? ">" :
\$o ? " " :
\$v ? (\$h ? " " : "-") :
(\$h ? "|" : "+")
);
}
print "\n";
}
__END__

Here's an example output.

```+-------+---+---+-----+---+-----+-+-+-----+-------+-+-+---+---------+-
++
|@      |   |   |     |   |     | | |     |       | | |   |         |
+|
+-- | +-+---+-- | ----+ | | --- | | +-+ +-+-+-+---+ +-+ | | | +---+-+
+|
|   | | |             | | |     | |   | | | | |     |   | | | |   |
+|
+-+ +-+-+ | --+-+-+   +-+ | +-+ +-+-+ | | +-+ | --+ +-- +-+ +-+-+ | --
++
| |       |   | | |   |     | | | | | | |   | |   |           | |
+|
+-+ | --+-+-+-+-+ | --+ ----+-+-+-+ +-+ +-- +-+---+ +-- +-- --+-+-- |
+|
|   |   | | |         |       | | | | | |           |   |     | |   |
+|
+---+ | +-+-+-----+   | | +-+-+-+-+-+ | +-+ +-- | | +-+-+-- +-+ | --+-
++
|   | |   | |     |     | | |   | |   |   | |   | | | |     | |
+|
| --+ +---+ +-+ +-+ --+ +-+-+-+ +-+ +-+-+-+ | --+-+ | | +---+ | | +-+
+|
|             | |     |   | | |     | | |   |   | |   | |     | | | |
+|
+-+-- +-+ | +-+ +-+-- +-+-+-+ +-+   | +-+-- +-+-+-+-+-+-+ | +-+ +-+ +-
++
| |   | | | |     |     | |     |     | |   | | | | |     | | |   | |
+|
| +-- +-+ +-+-+-- +-+ | +-+ +-- +-- --+ +---+ | +-+-+ | | +-+ | --+ |
+|
|       | |   |     | |   | |                   | | | | | |         |
+|
| +---+-+-+-- +-+ --+ | | +-+-- | | | +-+ | +-+ | | +-+-+ +-+ ----+ +-
++
| |   | |       |     | | |     | | | | | | | |   | |   |   |     | |
+|
+-+-+ +-+-+-+ | +-- | +-+ | | --+-+-+-+-+ +-+ +-+-+ | +-+ --+ | | | +-
++
| | |     | | | |   |   | | |   |     |   |     |   | |     | | |   |
+|
+-+ +-+-- +-+-+ +-+-+---+ +-+-- | ----+-+ | +-- +-+ | |   --+ | +---+
+|
|   | |   |     | |     | |           | | | |   | |
+|
+-+ +-+---+ +-- | +-+-+ | | +-------- +-+ | +-+ +-+ +-+ | +-+---- ----
++
| |   |     |   |   | | |   |             |   |     | | | | |
+|
| | --+ | --+ | | --+ | +-- +---+ --+ +-- | --+-----+-+-+ | | | | | +-
++
| |   | |     |     |   |       |   | |   |         | | | |   | | | |
+|
+-+ | +-+-----+---- +-+-+   | --+---+-+-+ | +---+---+ +-+ +-+-+-+ | |
+|
| | | | |     |     | |     |       | | |   |   |   |   | | | | | | |
+|
| | +-+-+ +-- +-- --+-+ | | +---+ --+ +-+ | | +-+-+-+ | | | | | +-+ |
+|
|     | | |         | | | | |   |   | |   | | |   |   | | |   | | | |
+|
+-+ +-+-+ +---------+ | +-+-+ --+ --+ | +-+-+-+ | +-+-+ | | +-+ | | |
+|
| | | |   |         | | | |             | |     | | |   |   |   | |
+|
| | | | | | +-----+-+-+ | | | ----+ +-+-+-+ | +-+-+ | | +-+ +-- | | |
+|
|   |   | | |     | |     | |     | | |   | | | |   | |   |     |   |
+|
|   +---+-+-+ | | | +---- +-+ ----+-+ +-+-+-+ | +-- | +-+ +-+-- +-- |
+|
|   |         | |                 |   | |   | | |       |   |   |   |
+|
+-+ +-- --+---+-+ +-+-- +-+-- --+-+-- | | | | +-+ +-+-+-+ --+ +-+-+-+
+|
| |       |     | | |   | |     | |   |   | |   | | | | |   | | | | |
+>
+-+-------+-----+-+-+---+-+-----+-+---+---+-+---+-+-+-+-+---+-+-+-+-+-
++

In reply to Random maze generator by ambrus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
 [Discipulus]: :=) [johngg]: hippo Yes, that's a cracker :-D [Discipulus]: hippo take a look at Re^2: Cookie->fetch problem [Discipulus]: oh and dont miss my last poetry!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-05-26 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favorite model of computation is ...

Results (189 votes). Check out past polls.