note
eyepopslikeamosquito
<P>
Despite being [id://811919|shocked] that Jasper and I had
<I>totally</I> different 101 stroke solutions to the Saving Time
challenge, I had a feeling that Rhebus and I would have similar
solutions to this one.
There just seemed to be much less scope for magic formulae
and general weirdness in the beer bottle game.
I've contacted Rhebus and am pleased to report that he was
as curious as I was and happy
to compare our solutions in the hope of unearthing an even
shorter one.
Here is his 162 stroke winning entry:
<CODE>
@a=(++$a." bottle$& of beer",on,the,wall),s/^/
Take one down and pass it around, @a.
@a, $a[0]./,/s/until/
99/;print"99$'
Go to the store and buy some more, @a."
</CODE>
</P>
<P>
If you compare his with mine:
<CODE>
/s/until@c=(@b=(++$n,bottle.$&,of,beer),on,the,wall),s/^/Take one down and pass it around, @c.
@c, @b.
/,/, 99.*
/;print$'."Go to the store and buy some more$&"
</CODE>
you'll see some similarities and some differences.
The major difference is that Rhebus used a five stroke shorter
terminating regex, namely <C>/\n99/</C> instead of my <C>/, 99.*\n\n/</C>, that unfortunately cost
five strokes elsewhere: two strokes for the extra <C>99</C>
at the front of the printed string and three for the terminating <C>, @a.</C> (instead of <C>$&</C>)
at its end.
</P>
<P>
Can these two solutions be combined somehow to produce a shorter one?
I can assure you that <I>many</I> variations are possible but I
couldn't find any reductions.
So if you can further shorten it, you can claim to be the
inventor of the shortest solution to the most popular golf
game of all. :)
</P>
903641
903641