With the same idea for Sierpinki:
#!/usr/bin/perl -l
print,s/^/_/,s/./$'& z^$&^Z/eg,y/5/o/for($a=o)x80
There are a variety of Sierpinski triangle solutions
given in the documentation for Acme::EyeDrops.
For example, this short one was composed by mtve in 2002:
#!perl -l
$x=2**pop;print$"x--$x,map$x&$_?$"x2:"/\\",0..$y++while$x
This version takes a single command line argument;
running "perl sier.pl 5", for example, produces the same
result as that shown in Re: Pascal-Sierpinski for golfers.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|