Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Best 8 Character Obfuscation (Golf-ish)

by mr.nick (Chaplain)
on Jun 04, 2001 at 07:05 UTC ( [id://85399]=perlmeditation: print w/replies, xml ) Need Help??

Okay, I have an interesting task here if you are interested :) What is the most clever obfuscation/golf can you write with the following simple rules

  • Maximum of eight (8) spaces
  • You can only use the following characters
    . ' ! : - (which count for 1/2 space)
    & ? $ = # ' + / * (which count for 1 space)
    " (2 spaces)
    A-Z0-9 (1 space)

Now, if this sounds suspiciously like the restrictions placed on you by the Department of Motor Vehicles for a custom plate, well, yes, (ahem) you would be correct :)

I've been trying to think of something clever I can fit into 8 spaces (which, if 1/2 space chars are abused well enough, I expect can be as long as 12 characters). Problem is, the muse of cleverness isn't with me; the best I can do so far is a simple regex like s!.+!JAPH!. So I appeal (more out of interest of SEEING as opposed to actually USING it) to my fellow monks for some input.

Thank you for your time! :)

Replies are listed 'Best First'.
Re: Best 8 Character Obfuscation (Golf-ish)
by MeowChow (Vicar) on Jun 04, 2001 at 08:22 UTC
    A Perl-to-Java converter:
    perl -pe "s-\b \b-.-g" FILENAME
    update: And here's a cute 'lil bug i just discovered:
    perl -pe "s--s:()::g-e" FILENAME
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      Why the '()'s? Without them, it seems to work. (But then there's no bug. I guess that's your point.)

        p

Re: Best 8 Character Obfuscation (Golf-ish)
by Zaxo (Archbishop) on Jun 04, 2001 at 17:19 UTC

    The possibilities get richer if you consider mere expressions and puns on them.

    $$==0 for 'swapper' (a little old-fashoned, that)

    $?!=0 for 'baby on board'

    Regex matches can make an assertion...

    /VIP/

    ...or even tell a sad story.

    /DWI/

    $&=1/4

    /APB/

    $!!=0

    /DOA/

    After Compline,
    Zaxo

      Having the word "DWI" on your license plate is a bit like walking around a hunting grounds with a pair of antlers strapped to your head :-)
         MeowChow                                   
                     s aamecha.s a..a\u$&owag.print
        Can you explain for non-americans what it is with DWI. I think it closes a large namespace.
Re: Best 8 Character Obfuscation (Golf-ish)
by srawls (Friar) on Jun 04, 2001 at 22:17 UTC
    Here's one that fits exactly 8 chars (11 real chars):
    ++$...$..$.
    It evaluates to 1 .. 11. (To see why, go to this node.)

    The 15 year old, freshman programmer,
    Stephen Rawls
      That's great! Can you imagine a police officer trying to read your tags across a radio?? :)
        Yeah, and can you imagine an officer asking a witness, "did you get the tag? plus dollar dot dot what now?"

        Seriously though, I can just see people asking you about your plate everywhere you go; all the more reason to get it : )

        The 15 year old, freshman programmer,
        Stephen Rawls

Re: Best 8 Character Obfuscation (Golf-ish)
by John M. Dlugosz (Monsignor) on Jun 04, 2001 at 19:08 UTC
Re (tilly) 1: Best 8 Character Obfuscation (Golf-ish)
by tilly (Archbishop) on Jun 04, 2001 at 16:04 UTC
    I can't even manage a good joke in 8 characters. The best I could manage is that attempts to speak Python will not be understood:
    s:yt:&s:e
    (I know, I couldn't even manage a good job at *that* joke.)
Re: Best 8 Character Obfuscation (Golf-ish)
by petral (Curate) on Jun 04, 2001 at 16:32 UTC
    The absence of the lower-case makes this particularly difficult. $ARGV? $#INC? *SIG?!?

      p

Re: Best 8 Character Obfuscation (Golf-ish)
by the_slycer (Chaplain) on Jun 04, 2001 at 18:07 UTC
    Only a perlmonk would get it:

    4=31832
Re: Best 8 Character Obfuscation (Golf-ish)
by da (Friar) on Jun 04, 2001 at 22:27 UTC
    $0='CAR'

    but then people will confuse you for a ksh or sh programmer.

    ___
    -DA

Re: Best 8 Character Obfuscation (Golf-ish)
by suaveant (Parson) on Sep 10, 2001 at 23:51 UTC
    #!perl -wT

    that'd be a good license plate :)

    update I assume you need real letters, too but ...---... would be a funny plate...

                    - Ant
                    - Some of my best work - Fish Dinner

Re: Best 8 Character Obfuscation (Golf-ish)
by ZZamboni (Curate) on Jun 05, 2001 at 09:59 UTC
    Please let us know what you end up with! I would be particularly curious to see if the DMV will accept a symbols-only plate (like the ++$...$..$. suggestion). I have a feeling they would reject it.

    When I got my new car in January, I wanted to get a "PERLMNK" plate (only 7 characters plus a space in Indiana), but when I went to get the plates, I found out that they only issue vanity plates once a year: I would have to place the order and wait until next year, and I'm moving out of the state this year. Agh.

    --ZZamboni

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-19 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found