http://www.perlmonks.org?node_id=83007


in reply to PGA Golf, Round 1

Okay: here are my entries. They aren't particularly good, but they work which is fine for me.

Hole 1 - 21 chars

(split/[^\w_]/,pop)[4] 1234567890123456789001
Hole 2 - 24 chars
perl -e'\ \ \ \ goto TPC'
Hole 4 - 31 chars
map{chr(hex)}unpack("A2"x11,pop) 1234567890123456789012345678901
Hole 5 - 32 chars
$x=shift;map{$x=$_ if$_<$x}@_;$x 12345678901234567890123456789012
Hole 6 - 53 chars (ugh!)
sort{($a=~/([aeoui])/)[0]cmp($b=~/([aeiou])/)[0]}@_} 1234567890123456789012345678901234567890123456890123

Replies are listed 'Best First'.
Re: Re: PGA Golf, Round 1
by suaveant (Parson) on May 24, 2001 at 23:17 UTC
    I feel so smart... I actually pulled an obscure thing of my own... in perl // redoes the previous re, so
    sub hole{sort{($a=~/([aeiou])/)[0]cmp($b=~//)[0]}@_} 123456789_123456789_123456789_123456789_12
    cuts your hole 6 to 42 chars! my small moment of glory...

    Update realized I counted } in sub... actually 42 chars.. not 43...
                    - Ant