Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 rifling through the Monastery: (8)
As of 2014-09-23 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls