in reply to (Golf) Let's go bowling
If that is correct, then the following code is correct. If it is wrong, then I misunderstand the problem and don't have a solution at 103 characters.ball score total 5 5 164 / 16 159 6 6 143 3 3 137 X 27 134 X 17 107 7 7 90 0 0 83 4 4 83 3 3 79 X 20 76 4 4 56 / 18 52 8 8 34 1 1 26 3 3 25 / 16 22 6 6 6
sub hole { # 1 2 3 4 5 6 +7 8 9 10 #234567890123456789012345678901234567890123456789012345678901234567890 +1234567890123456789012345678901012345 $i=$s=0;for(@_=(0,0,reverse@_)){$s+=$_[$i-1]+$_[$i-(/X/?2:-1)],$_=/X/? +10:10-$_[$i+1]if/\D/;$s+=$_;$i++}$s }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re (tilly) 1: (Golf) Let's go bowling
by chipmunk (Parson) on Aug 09, 2001 at 00:35 UTC | |
Re: Re (tilly) 1: (Golf) Let's go bowling
by tachyon (Chancellor) on Aug 09, 2001 at 00:11 UTC | |
by tilly (Archbishop) on Aug 09, 2001 at 00:36 UTC | |
by tachyon (Chancellor) on Aug 09, 2001 at 01:11 UTC | |
by tilly (Archbishop) on Aug 09, 2001 at 02:53 UTC | |
by Brovnik (Hermit) on Aug 09, 2001 at 03:07 UTC |