Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Closest-value-in-list Golf!

by mr.nick (Chaplain)
on May 30, 2001 at 22:47 UTC ( #84342=note: print w/ replies, xml ) Need Help??


in reply to Closest-value-in-list Golf!

Hm. I used a different approach, and if my eyes don't deceive me, it's the lowest score yet. Update: No it's not ... damn:

sub g { # 1 2 3 4 5 # 1234567890123456789012345678901234567890123456789012 $n=pop;$,=pop;$,=abs$n-$_<abs$n-$,?$_:$,for@_;$, }
for a score of 48.


Comment on Re: Closest-value-in-list Golf!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-11-23 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (130 votes), past polls