more useful options PerlMonks

### pawel.biernacki

by pawel.biernacki (Acolyte)
 on Feb 23, 2018 at 18:35 UTC ( #1209854=user: print w/replies, xml ) Need Help??

```(\$w,\$h)=(25,10);%l=map{\$_,{map{\$_,0}1..\$h}}1..\$w;sub t{my(\$x,\$y)=@_;\$l
+{\$x}{\$y}|=1;my@c=grep{exists(\$l{\$\$_[0]}{\$\$_[1]})&&!\$l{\$\$_[0]}{\$\$_[1]}
+&1}map{[\$x+\$\$_[0],\$y+\$\$_[1],\$\$_[2]]}([-1,0,2],[1,0,2],[0,-1,4],[0,1,4
+]);@c&&do{\$c=\$c[int(rand(@c))];\$l{\$x<\$\$c[0]?\$x:\$\$c[0]}{\$y<\$\$c[1]?\$y:\$
+\$c[1]}|=\$\$c[2];t(@\$c);t(\$x,\$y);}}t(12,5);print join("",map{\$y=\$_;"X".
+join("X",map{\$l{\$_}{\$y}&2?"-":" "}1..\$w)."\n".join(" "
,map{\$l{\$_}{\$y}&4?"|":" "}1..\$w)."\n" }1..\$h);

The code above is a maze generator.

As you might have guessed I am a programmer. Take a look at my website http://www.pawelbiernacki.net .

Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2018-03-20 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (254 votes). Check out past polls.

Notices?