BB Obfuscated Code/Safari Books Online contest winner!

Discuss

21 Responses to “BB Obfuscated Code/Safari Books Online contest winner!”

  1. daen says:

    I’m sorry, but compared to the winner of the 2000 Obfuscated Perl contest, this is not especially wonderful. According to Les Peters, the author, this program comprises:

    two lines of code that parses two lines of embedded comments in the code to read the Mayan numbers representing the individual ASCII characters that make up the magazine title, rendered in 90-degree rotated ASCII art.

    Here it is in all its beauty. Bow down before it. C’mon, these are ASCII characters representing Mayan numbers representing ASCII characters! The man is an insane genius!

    #:: ::-| ::-| .-. :||-:: 0-| .-| ::||-| .:|-. :||
    open(Q,$0);while(){if(/^#(.*)$/){for(split('-',$1)){$q=0;for(split){s/\|
    /:.:/xg;s/:/../g;$Q=$_?length:$_;$q+=$q?$Q:$Q*20;}print chr($q);}}}print"\n";
    #.: ::||-| .||-| :|||-| ::||-| ||-:: :|||-| .:|
    

    It prints out … Well, why spoil it? Run the code, but have a guess first. Do you get it? Do you really get it?

  2. Teresa Nielsen Hayden / Moderator says:

    It’s traditional to congratulate the winner.

  3. arkizzle says:

    I thought this was great!

    Well done all and MCD. I am not quite the obfuscation-connessiur that some here seem to be, but when I ran MCD’s code and BOInGBOInG popped out, I burst into a grin.

    Well done again! I will have to check out some other examples in the thread (which I somehow missed the first time).

  4. finisterre says:

    > This little snippet would be a lot easier to try out if it wasn’t a f#$%ing jpg. Boo!

    Quite – http://lbrandy.com/blog/2008/10/my-first-and-last-webcomic/

  5. daen says:

    C’mon, there should be a total mental disconnect in obfuscated code competitions between what you read in the code itself and what appears on the screen when you run it. Pithy and terse do not necessarily an obfuscated code winner make. There should ideally be hours of head-scratching and debugger work in figuring out how a three-line obfuscated C program can possibly print “Bloom County” in an elegant cursive ASCII art font, alongside versions of the strip’s main characters, with the O’s for Opus’s eyes. You should go blind and/or mad with frustration after picking apart the keyboard salad of obfuscated Perl that turns out to be a fully featured Atari 800 emulator, including the POKEY chip and joysticks. And so on. These kind of programs should look like invocation rites for some kind of demonic entity rather than an exercise in well structured code, and should leave you feeling as equally awestruck as if you had been in the Dark One’s presence, if not necessarily by virtue of the result then in the execution.

    I have said my piece.

    Congratulations to the winner, in traditional sour-grapes loser fashion.

  6. Antinous says:

    Dude,

    You didn’t even enter the contest. That’s not sour grapes. That’s just a big steaming pile of fail.

  7. Takuan says:

    honest, orcish, but honest

  8. mdh says:

    if only he’d said his peace.

    (FYT)

  9. McD says:

    Ahem. W00T! :-)

    Daen – you’re right, this doesn’t hold a candle to most obfuscated Perl. (Shoot, it’s cleaner than some production code.) But the original call was for “…the shortest, most elegant, or creative bit of code” – and to that end, I thought this fit the bill perfectly. Brevity being the soul of wit, and all that, you know.

    And for Naomind, the code simply takes advantage of an obscure feature of Perl that SamSam noticed, documented here. If you increment a non-numeric string, you get a “string increment” with carry. So you can get from “McD” to “BOInG” just by incrementing a number of times – but (as in so much of life), the real trick is knowing when to stop.

    Congratulations to all the competitors, there’s some truly baffling code in there. I’ll leave you with a quick link to my favorite obfuscated Perl of all time, Erudil’s classic Camel Code.

    Peace,
    -McD

  10. mdh says:

    I’m sorry, but

    ahem, you forgot to close your b.s. tag there.

  11. Joel Johnson says:

    It was close enough. :)

    And honestly, almost every entry was amazing. You guys should really go check out the other ones.

  12. ricket says:

    This little snippet would be a lot easier to try out if it wasn’t a f#$%ing jpg. Boo!

  13. Anonymous says:

    I guess I’ve been in the mines too long; it seems like pretty straightforward perl to me.

    I was playing games with I/O buffer width and ephemeral pseudo-devices in mine, but I suppose nobody else found it amusing. Such things are most likely taken for granted in the post-x86 world… Oh well.

    Congratulations, McD! Well played!

    –Charlie

  14. Anonymous says:

    This must be a sign. I just found Safari Books Online yesterday, they have a large selection at an OK-ish price. It was almost too good to be true, there had to be a catch, like some sort of DRM or something. But I trust BoingBoing not to be sponsored by some scam.

  15. SamSam says:

    Ha! That’s pretty good: Simplicity itself if you know that you can ‘++’ a string, but very difficult to work out what it will print in advance without actually running it.

  16. sardonicbastard says:

    Well, let me be the first to point out that the program doesn’t print out the string “Boing Boing.” and should thus be ineligible for the contest… but hey, you guys make the rules.

  17. Galoot says:

    My feed reader didn’t show the .jpg, so I couldn’t read the code until I came here directly. But as soon as I saw that Joel chose MCD’s entry I immediately thought, “Oh, the memorable one!”

    Great choice. Congrats, McD.

    Joel, I give up. What does “lureour” (the <alt> text) mean?

  18. KWillets says:

    Didn’t James Joyce once win an obfuscated literature contest?

  19. naomind says:

    That looks really cool. Could one of you Perl coders kindly explain how this script works? Inquiring minds want to know.

  20. Anonymous says:

    A tech writer I know once referred to these obfuscation contests as “carrying coals to Newcastle.”

    As a working coder confronted with Perl and even COBOL on a regular basis, I can only concur.

Leave a Reply