Sierpinski triangle: Difference between revisions

elided the 2nd Peal entry, added a "version 1" to the first example, convert the section head "one liner" to a version entry.
(elided the 2nd Peal entry, added a "version 1" to the first example, convert the section head "one liner" to a version entry.)
Line 2,798:
 
=={{header|Perl}}==
===version 1===
<lang perl>sub sierpinski {
my ($n) = @_;
Line 2,811 ⟶ 2,812:
print "$_\n" foreach sierpinski 4;</lang>
 
=={{header|Perl}}=one-liner===
oneliner:
<lang perl>
perl -le '$l=40;$l2="!" x $l;substr+($l2^=$l2),$l/2,1,"\xFF";for(1..16){local $_=$l2;y/\0\xFF/ */;print;($lf,$rt)=map{substr $l2 x 2,$_%$l,$l;}1,-1;$l2=$lf^$rt;select undef,undef,undef,.1;}'</lang>