in reply to
Re: Re (tilly) 3: (Golf) Let's go bowling
in thread (Golf) Let's go bowling
Grrr. All of the way up to 175:
sub score {
$i=$s=0;map{$b=!(++$i<5&&$_[4]eq X||4>$i&&$_[3]eq'/');$s+=$b*$_[$i-2],
+$_=/X/?($s+=$b*$_[$i-3],10):10-$_[$i]if/\D/;$s+=$_ if$b}@_=(0,0,rever
+se@_);$s
}
Note that this does not pass the final test in your suite, but the score given in the final test cannot come from a real bowling game. Remove the trailing 0 that I am sensitive to and I pass.
Ah well. Yet another cute idea killed by horrible boundary conditions.