Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: PGA Golf, Round 1

by the_slycer (Chaplain)
on May 24, 2001 at 22:24 UTC ( [id://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 :-)

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://83046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-24 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found