5th Obfuscated Perl Contest Winners 110
strredwolf points out that
we have winners
of the Fifth Annual Obfuscated Perl Contest, noting, "Unfortunately, my virtual machine didn't win."
(Insert loser-condolences here.) BTW, I noticed problems with the code as printed: the winner of category 2 lacks a terminal quote, and I couldn't get the category 3 winner to compile even after fiddling with whitespace. Put up a webpage with code I can copy-paste-and-run,
email me,
and I'll update this story with your link.
Don't say anything bad about Perl (Score:1)
Just one word.. (Score:1)
Re:Writing obfuscated Perl (Score:5)
Add an undermounted grenade launcher, and you've got the Obfuscated LISP contest.
Not very artistic... unlike Obfuscated C entrants. (Score:5)
This is not a flamebait.
Anyone can run Perl code through a perl-built obfuscator. Heck, one of the winning entries was an obfuscated perl-built obfuscator. How... imaginative.
I have lost my hardcopy of the Obfuscated C contest entries, but it seemed like they had a lot more spirit, and thought about the artistic side, on more than one level.
For example, one winner of Obfuscated C wrote a simple maze generator. However, the source code to the maze generator was itself a maze, with whitespace passages going up and across and down through the code. To top it off, those whitespace passages that cut through the code spelled out the word "MAZE", if you stood back far enough to see it. The main variables used were m, a, z and e, as well.
The closest to 'artistic' Perl source that I have seen is the "RSA Dolphin," where the RSA algorithm is formatted to have the silhouette of a dolphin. That's still only one level of art.
Re:Could someone please, (Score:1)
Re:Writing obfuscated Perl (Score:1)
Kierthos
Perligata (Re:too easy) (Score:4)
Re:Not very artistic... (Score:1)
Each language naturally tends to produce obfuscated code in its own idiom. The obfuscated Perl in the contest has a variety of levels of obfuscation, and some of it is wonderfully logically obfuscated as well as simply hard to read. I'll admit that the obfuscated Perl folks do tend to produce extremely dense, hard to read material, but there's also a lot of genuine logical obfuscation in there, too.
Re:Unfair (Score:1)
Re:Writing obfuscated Perl (Score:1)
And it must be understandable by a five-year old or a politician....
That would be the ultimate coding contest...
Kierthos
Re:Geez... a lot of bitter C people here (Score:1)
http://perl.apache.org/embperl [apache.org]
Re:Could someone please, (Score:1)
In layman-ish terms: the frogger script as submitted was encrypted. When run it decrypts itself and runs the decrypted stuff. The decrypted stuff is much easiar to read. He even provided a formatted decrypted version. :)
Also: to run it I think you need to import the tk module on the command line.
Re:(at the risk of starting a flame war:-) Python (Score:1)
The real challenge: the obfuscated Python contest (Score:1)
--
Re:Unfair (Score:1)
That's really confusing. (Score:2)
#!/usr/bin/perl /bush/; /gore/;
while (<BALLOT>) {
$bush++ if
$gore++ if
$gore++ if $chad{$pregnant};
$gore++ if $chad{$hanging};
}
Re:Eh? (Score:2)
For example, a Perl regular expression for matching can be plenty painfull to read... but it replaces 3 pages of nested and snarled looping in C++. Hardly an easy read either, and lots more opportunity for defect. You can use the regular expressions in C++, but they might not work (at least not the ones I tried) and will be even uglier...
Also, while Perl is weakly typed and does not declare types (or even necessarily variables), you still can know the difference when you need to. Consider the two examples below.
What does the perl do? Compare the number in $foo to the number in $bar. If it were comparing strings, it would have used the "eq" operator instead of the "==" operator.
In C++, who knows what is being compared unless you can track down the class declaration for foo and bar. Further, this class definition probably inherited from about 3 other levels of classes, each of which must be checked to see who (if anyone) overloaded the "==" operator. The base class probably used a template, which you have to find. Then, if you can even find the headers for all the clases and the template, you get to parse the actual overload for the "==" operator to see what on earth it is doing.
Granted, the C++ example has considerably more complexity... but either language can be completely and equally illegible.
The more I use C++, the more I like Java, but that's a different topic...
Bill
Re:Supreme Obfuscation Talent (Score:1)
(This is a common error
-Bill
Re:Writing obfuscated Perl (Score:2)
---
Re:Found it! (Score:1)
OK, I tried the C code which admittedly is remarkable, but it doesn't generate a very complicated maze. It looks like:
Well, I'd show you what it looks like, but I hit the lameness filter. It has one path across the bottom of the maze, and a number of straight dead-end passageways going up to the top. Does this work for anyone else?
Re:Perligata (Re:too easy) (Score:2)
And this we owe that to the great Damian Conway. [monash.edu.au] This is the Perl God who teaches CS in Australia, and who defied the skeptics (uh, that would be me) by soliciting and getting enough donors next year to hack perl rather than slay undergraduates. (Whoops! I meant "teach undergraduates"; guess I'm just projecting or something...) The note I got from Professor Conway thanking me for my contribution to his rescue^H^H^H^H^H^Hresearch leave would have been suitable for framing, except that it was sent via email.
Obsfucated Visual Basic (Score:1)
For Each knob in house
Dim lights
Next
the obfuscated contests... (Score:1)
The ftp site ftp://ftp.uu.net/pub/ioccc/ [uu.net] contains information regarding 'The International Obfuscated C Code Contest'. One of the best programs ever seen in these contests is one written by Brian Westley in 1988 which prints 3.141 (the mathematical constant pi) on the screen using the source code shown in ...
ftp://ftp.uu.net/pub/ioccc/1988/westle y.c [uu.net]
this is taken from my Java lecture notes (What is Java) - basically saying what the goodies they took out of C/C++ to create Java were :P
oh boy, were my students pissed when i said i loved this stuff :P
No kidding... (Score:2)
I still have a copy of the IOCCC entry which consisted of an ASCII-art circle drawn inside main().
The program calculated an approximation of pi by figuring out the surface area of its own source code. The bigger the circle, the more accurate the approximation.
I think even the Jargon File mentions that one as an example of true obfuscation. The Perl entries are just... sophmoric.
Re:Not challenging either (Score:1)
Its as easy to write un-obfuscated perl as it is not to shoot yourself with a gun.
Its hard to write 25000 lines of code in perl because it gets the job done in a lot less (and someone probably wrote a freely available module for it anyway).
Re:Could someone please, (Score:1)
Really bad, completely unintelligable Perl was because they didn't read all the man pages before they started coding.
--Ty
Re:Worthless (Score:1)
Would you feel better if we had a contest to see who could convert obfuscated Perl to truly elegant, readable, portable, maintainable Perl? We could use the winners of this contest as the fodder for the "Disobfuscated Perl Contest".
Hmm. I intended this as a joke (a non-flame for your non-flamebait), but I kind of like the idea now.
My mom is not a Karma whore!
Re:Worthless (Score:2)
Besides, the joke now is to either come up with an off-the-wall program in the first place (I never would have thought of Frogger in readable Perl, let alone that mess), or pull in the strangest form of obfuscation (Mayan numerals!?)
I still think the ultimate challenge would be obfuscated Python. Real artists would know what to do with significant whitespace!
We're not scare-mongering/This is really happening - Radiohead
I don't know... (Score:1)
I think I'm just thankfull that I don't know how to do that.
Re:too easy (Score:1)
Don't you mean, "Dude, I started doing this once, but then, um, like, I got a life, ok.."
--Ty
Getting any of them to compile.... (Score:2)
Some unpublished code... (Score:1)
I've always coded badly, but it's nice to be recognised for it.
Proposal for a real challenge... (Score:1)
I suspect any language can be obfuscated, often by accident. Now how about this:
De-obfuscated INTERCAL
Of course, this might take a while.
Re:Could someone please, (Score:1)
Re:Writing obfuscated Perl (Score:1)
Re:Writing obfuscated Perl (Score:1)
--
The entries (Score:5)
lack of return spaces (Score:2)
Self-imposed /. effect? (Score:2)
Thanks, but no thanks. I may as well just unplug my webserver -- the end result is roughly the same as posting a link to it on the front page of
-j
Re:Unfair (Score:1)
Re:Unfair (Score:2)
Re:Perligata (Re:too easy) (Score:2)
This reminds me of the old adage... (Score:2)
Found it! (Score:3)
Very interesting reading on maze theory.
Obfuscated One Instruction Set Computing code? (Score:3)
You've heard of RISC, Reduced Instruction Set Computers? Well, here is the concept taken to its logical extreme -- an emulator for a computer with just one (1) instruction (Subtract and Branch if Negative)! Sample programs in the OISC machine language are included.
ESR has an OSIC emulator [tuxedo.org].
Here is my qualm with most obfuscated contests (Score:2)
If you're going to hack XML... (Score:2)
Perl and XML don't really get along well, primarily because Perl and arbitrarily nested data structures don't really get along well (see here [xml.com] if you want a less biased, but still discouraging opinion).
Strangely enough, Java and XML aren't getting along as well as one would think, if this article [sdtimes.com] on the JDOM project is any indication. Java also has the shifting sands problem - vendor-controlled standards are evil, no matter who the vendor is.
Common Lisp has an ANSI standard that hasn't changed since 1995, open-source multi-threaded web servers that you can add native code to on the fly (see AllegroServe [sourceforge.net] or CL-HTTP [mit.edu]) and a lot of other good stuff that I don't have time to list here.
Re:Writing obfuscated Perl (Score:1)
which when interpreted under the correct socio-economic condtions spells...Ebonics!
--
Re:Am I missing something? (Score:1)
Re:the obfuscated contests... (Score:1)
ftp://ftp.uu.net/pub/ioccc/1992/westley.c [uu.net]
$ gcc -o world westley.c ./world -40 115
$
and, you'll get a nice little map! *yay*.. my home town, Perth, Western Australia. pass the lat, long and wola.. it'll show you where it is.
Terminal quote in second sample. (Score:3)
Just add a quote at the end yourself. Then it compiles without error
Re:Could someone please, (Score:3)
I'm not a programmer, but that seems to be cheating. Too many of the entries rely on self-extracting or self-decrypting code. Perhaps the contest judges should have separate categories for obfuscated programs which aren't self-modifying, or at least aren't compressed or encrypted.
Re:(at the risk of starting a flame war:-) Python (Score:1)
PyApache [egroups.com] is what I use, no troubles with Apache 1.3.14 and Python 1.6; hackable.
Mod_Python [modpython.org] which is closer to mod_perl in philosophy, I think.
Mod_Snake [sourceforge.net] which is kinda like the same thing only different.
The latter two projects don't offer me enough enhancements to make me switch from PyApache yet; so I haven't as much experiance with them. PyApache has the feel of a defunct project, I haven't heard of any efforts to make it work with (Apache|Python) 2.0+
Just to keep this from being completely offtopic, Obfuscated Python is possible. AMK's ARC4 in python is a good example. If you're feeling particularly evil you can do really nasty things by mixing tabs and spaces and taking advantage of the fact that indentation need not be constant throught a file (this block @ 3, next @ 5, one after that at 4, etc.)
Obfuscated web page. (Score:1)
Supreme Obfuscation Talent (Score:4)
Re:Writing obfuscated Perl (Score:2)
I was going to say that an obfuscated Perl contest made about as much sense as an obfuscated APL contest. I mean, how could you tell?
(BTW, I did APL tech support for a couple of years. It is possible to write unobfuscated APL, but actually seeing an unobfuscated APL program "in the wild" is about as likely as seeing an unobfuscated Perl script.)
APL is a terminal disease
-- joke dating back to when APL was run on mainframes from terminals with wierd character sets.
EO (Score:1)
Amorphis
Next Contest... (Score:1)
I just started learning Perl... (Score:2)
Re:Writing obfuscated Perl (Score:1)
Perl (Score:2)
Envision just what these
Really did, I could
Let my machine try and run them...
ChAoS
Eh? (Score:1)
Re:Not very artistic... unlike Obfuscated C entran (Score:4)
(At least, this is how I remember it. Somebody correct me if I'm wrong).
Re:Not very artistic... unlike Obfuscated C entran (Score:1)
And, no, it wasn't this:
print <<EOF
My Obfuscated Poem
...
EOF
Re:Writing obfuscated Perl (Score:1)
Considering the article we recently had about the Basic language for the PS2, how about an obfuscated Basic contest? That way some of the oldtimers can join as well...
Re:Writing obfuscated Perl (Score:3)
--
Re:too easy (Score:1)
Re:Writing obfuscated Perl (Score:1)
I took third place in this contest...! :) (Score:3)
Re:Writing obfuscated Perl (Score:1)
Fortunately, the APL symbols are included in Unicode! Starting with the I-beam at hex 0x2336. The code charts are here [unicode.org].
Re:I don't know... (Score:1)
I dunno about this --- it seems to me that if you can do this, you know enough to know how not to do it as well. Kinda like, after watching "Quake Done Quick With A Vengeance", I knew that I didn't want to deathmatch the authors.
Re:too easy (Score:1)
http://www.cs.bgu.ac.il/~omri/Humor/verbose-c.h
Re:Worthless (Score:1)
And what's so original about just cramming your code into unrecognizable encrypted garbage? Where's the style? Whatever happened to a program whose source code formed an ASCII graphic of what it would do, or something...
Re:Obfuscated Perl? (Score:1)
Re:Writing obfuscated Perl (Score:2)
Re:The entries (Score:1)
Ok, it was pretty pitiful, and for some reason didn't make it into a category, but I was proud. I don't remember why I didn't write something longer, though. I guess I thought there was a 256 byte limit, and it was actually 512 bytes?
---
pb Reply or e-mail; don't vaguely moderate [ncsu.edu].
Re:Writing obfuscated Perl (Score:1)
Re:too easy (Score:2)
#define bar {
#define baz }
but it's not possible to use special characters or reserved words in the define. defines are "cute" but they're not really obfuscated anyway, since you can just grab the output of the preprocessor and see the unmunged source.
--
"Don't trolls get tired?"
Re:One liners... (Score:1)
Truly Obfuscated Perl - in Latin (Score:2)
check it out here [monash.edu.au]
Abstract
This paper describes a Perl module -- Lingua::Romana::Perligata -- that makes it possible to write Perl programs in Latin. A plausible rationale for wanting to do such a thing is provided, along with a comprehensive overview of the syntax and semantics of Latinized Perl. The paper also explains the special source filtering and parsing techniques required to efficiently interpret a programming language in which the syntax is (largely) non-positional.
Writing obfuscated Perl (Score:3)
What I want to see is obfuscated Pascal, or better Modula 2, contest. This would be sport, gentlemen. Obfuscated Perl isn't, I'm sorry.
--
Re:too easy (Score:1)
sort of... (Score:2)
#define long {
and then when you declare a long, you're fscked. you can't
#define long {
#define baz long
and then use 'baz bar' to set bar to be a long.
you also can't
#define { } (just won't work, illegal macro name)
any obfuscation done this way, is really just "cute" obfuscation anyway. I mean, you have to provide an easily readable translation key.
--
"Don't trolls get tired?"
too easy (Score:3)
I would like to see a contest for programs that are readable and work even though they shouldn't, like if you create a c program which includes a bunch of macros
#define like {
#define ok }
#define um ;
#define int dude
etc
then you can write fairly serious programs in valley speak. I started doing this once, but then I got a life..
Could someone please, (Score:1)
Re:Getting any of them to compile.... (Score:3)
Re:Could someone please, (Score:1)
Not really. If you download the entries and look at some of the solutions you'll see that they are indeed *designed* to be obfuscated.
From the frogger entry's SOLUTION:
and so on..Geez... a lot of bitter C people here (Score:2)
I think Flash, Perl, and XML are my favourite ingredients. Once I get it worked out, sure, I'll call up my C-loving friends to bum the code down to a fast binary, but I aint got the time or patience to screw around.
Are there any Perl people out there who can tell me a good reason to learn PHP too? Or should I go the other direction and pick up some Java (considering I want to focus on XML and Web development)?
Don't take it as a dis, folx. I love you weird C people, and all your stories about that time you wrote a routine in a assembler...
Re:Could someone please, (Score:2)
As just another perl hacker I found the best of show truly pathetic. The rest were fairly readable as soon as you'd put a few newlines in.
The quality is lower than the IOCCC, certainly, but I think that is because Perl is inherantly noisier (as in SNR) if you use all the inbuilt features, so people go to less effort to make it ugly, it's most of the way there already.
Truly obfuscated Perl uses an unfathomable algorithm as well as undecipherable presentation.
FatPhil
(Repeated IOCCC loser!)
adduser whatthehell (Score:2)
Better yet, pick up an old 486 for fun stuff like screwing around with experimental file systems.
--------
Perl? Syntax? (Score:2)
Obfuscated code proves to me that I KNOW NOTHING. The Frogger entry parses. And does nothing. It seems to be filled with ANSI codes. But it still does nothing for me, and I can't figure out why (it would do anythin). The inner-beauty entry fails to parse (for me). The final, Best Of Show Entry, is actually interesting, makes some sort of sense, and does what it is supposed to. It gains it's obfuscated title because of it's approach, not it's writing or syntax.
I thought I had a firm grasp on perl syntax. I thought I could debug any program less than 4k in 30 seconds. Umm...this contest always proves me wrong.
If nothing else, this proves that you can write an open-source perl trojan horse that even I might run to see what it does...
Obfuscated Perl? (Score:2)
Re:Not very artistic... unlike Obfuscated C entran (Score:3)
The tic tac toe program where the source is the board (recompile for next move)
The program that flips a square text file about the main diagonal, and when fed its own source produces a different c program that does the smae via a different method
A LISP compiler (in under 1KB)
The adventure game where your commands are compiler options and the response is the errors
and my favorite, the first ever winner:
it's a one-line program that confuses the Slash code :(. It's the first one, by an anonymous author.
so for those interested, its worth a read. I think Slashdot covers it every year, but I don't really feel like digging up links. happy reading (err... confusion?)!
Re:Writing obfuscated Perl (Score:2)
Not challenging either (Score:5)
In this, the entrants must write a non-trivial application, entirely in Perl, that has to be completely portable across at least 3 implementations (including one on Windows) and at least 25,000 lines of code (not counting comments).
Judges will introduce a bug into each program that would be obvious if you knew what the program did. Each bug *must* involve a cascade from an ambiguous or subtle misuse one of Perl's much-heralded "Do what I mean" functions.
A panel of experienced Perl programmers will be given the programs to debug. The program that takes the least average time to debug wins.
That's a contest.
obfuscatedpost (Score:2)
itmakesthispostalittlemoreconfusingthannormalma
itwouldbeevenmoreconfusingifitookmyfingersoffof
homekeyskiijdkujruyudfromthatyoushouldbeabletof
outwhatkindofkeyboardimtypingondamnlamenessfilt
IOCCC (Score:2)
Unfair (Score:5)
AG
Re:Worthless (Score:2)
I would argue that any program written in a language you don't understand or with techniques you don't understand is Obfuscated to some degree.
I've seen beautiful, easy to read and understand Perl code, and I've seen Perl code that should cause the machine it was written on to burst into flame. Hell, I've written both of the above.
It all really depends on the effort you put into it, just like in any language.
I've written Perl and C that didn't make sense to me the next day, and I've written both that were obvious to everyone that's ever seen them.
It's the coders use of the language that makes the critial difference I think.
--Ty
Obfuscated perl is heartless (Score:2)
Obfuscated C however, is a bit more difficult, and the results are therefore more appealing to me.
C of course, is prone to abuses to (#define...), what I'd really, really like to see is an obfuscated java contest. Its harder to mess with java then it is with those other languages, I wonder what ingenious hackers would be able to think up there...