Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sierpinski Triangle

by eyepopslikeamosquito (Archbishop)
on Aug 21, 2002 at 12:36 UTC ( [id://191708]=note: print w/replies, xml ) Need Help??


in reply to Sierpinski Triangle

Still going! Though not shortest, I find this one amusing for some reason. Oh, and I have given it a name: "five substitutions".

#!perl -l s--$"x$^F**pop-e,s-.-s,,,,s,$,/\\,,print,s,(?<=/.)..,$&^h9^gE,ge-ge

Update: here is a more elaborate one - using a "ge" theme - mentioned in The Lighter Side of Perl Culture (Part III): Obfu (it takes a command line argument (1-9) indicating the triangle size):

#!/usr/bin/perl -l s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e)<<pop).!gE-ge, s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,ge, print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,ge-ge

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://191708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found