in reply to Re: Re: Golf - now for the Sentencing.
in thread Golf - now for the Sentencing.
I believe grep wants everything to be lowercased other than beginning of sentences and single I's.
Well, that's what I get for reading the rules only, and not his solution. Clearly, the intent of that code is to lowercase everything else. I cannot beat 31, and nor does japhy — his code is identical to yours, except for your trailing ";" and variant delimiters (and if he can ignore the test harness, so can you).
(But I would have found the same! :-)
Now, of course the lc version is shorter and therefore better, but I could not leave this without some code, now could I? This is at 35 strokes; the best remains at 31.
# 3456789 123456789 123456789 12345 s/(^.|\.\s*.|\bi\b)|(.)/\U$1\L$2/g;
The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"
|
|---|