Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: (Golf) Let's go bowling

by dfog (Scribe)
on Aug 09, 2001 at 01:27 UTC ( #103238=note: print w/ replies, xml ) Need Help??


in reply to (Golf) Let's go bowling

Been a long time since I've had time to try one of these. My solution seems to be 168 characters, if I counted them properly.

sub score { $i=$z=0;@_=map{(/\d/)?$_:10}@_;while($i++<10){$x=shift;if($x<10){$y=sh +ift;$z+=($y==10)?10+$_[0]:$x+$y;}else{$z+=($_[0]==10)?20+$_[1]:($_[1] +==10)?20:10+$_[0]+$_[1];}}$z; }
Dave


Comment on Re: (Golf) Let's go bowling
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2015-07-30 06:12 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 (270 votes), past polls