Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: PGA Golf, Round 1

by the_slycer (Chaplain)
on May 24, 2001 at 22:24 UTC ( #83046=note: print w/ replies, xml ) Need Help??


in reply to PGA Golf, Round 1

Well, not fully complete - missing 3 and 6, maybe I'll update those later (I have to actually work now). Here are my attempts.
First time golfing :-)

Hole #1 (score 10): sub b{(split)[4]}
Hole #2 (score 21):
perl -e'

goto TPC
'
Hole #4 (score 47): sub b{$_=reverse;push@_,chr(hex(chop.chop))while$_;@_}
Hole #5 (score 32): sub b{$t=pop;for(@_){$t=$_ if$_>$t}$t}
Update: Thanks tilly, I would never have noticed hole 5 - though I had some bad feelings about it. I don't know WHAT I was thinking for #1 :-)
update2: changed 5 to a working one now :-)


Comment on Re: PGA Golf, Round 1
Select or Download Code
Re (tilly) 2: PGA Golf, Round 1
by tilly (Archbishop) on May 24, 2001 at 22:40 UTC
    Hole 1 is wrong. (Words cannot include, for instance, punctuation.)

    Hole 5 is wrong. (You are wrong if $t starts larger than any number in the list. Think of a list of negative numbers.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-06 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls