<?xml version="1.0" encoding="windows-1252"?>
<node id="83114" title="Re: PGA Golf, Round 1" created="2001-05-24 20:27:08" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="69487">
ChemBoy</author>
<data>
<field name="doctext">
&lt;dl&gt;
&lt;dt&gt;Hole 1 (18, or 16 if I can take a free drop on [pop])&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;sub {(pop=~/\w+/g)[4]}&lt;/code&gt;&lt;/dd&gt;
&lt;dt&gt;Hole 2 (24 in tcsh)&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;perl -e'\
\
\
goto\
TPC'
&lt;/code&gt;
Which has been said before, to be sure.&lt;/dd&gt;
&lt;dt&gt;Hole 3 (20)&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;sub {pop=~/^(.+?)\1+$/;$1}&lt;/code&gt;
&lt;bR&gt;which takes a 1-stroke penalty for the lack of /s, and one for $ instead of \Z. Oh well.&lt;/dd&gt;
&lt;dt&gt;
Hole 4 (19)&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;sub {split//,pack"H*",@_}&lt;/code&gt;&lt;br&gt;
or&lt;br&gt;
&lt;code&gt;sub {map{chr hex}pop=~/../g}&lt;/code&gt;&lt;br&gt;
for one more stroke and a warmer fuzzier feeling (since I actually got that one done in the time limit).&lt;/dd&gt;
&lt;dt&gt;Hole 5 (30)&lt;/dt&gt;
&lt;dd&gt;
&lt;code&gt;sub {$a=pop;for(@_){$a&gt;$_ or$a=$_}$a}&lt;/code&gt;&lt;br&gt;I think this is optimal for Perl 5.004
([tilly] can do it better with a more recent revision, I know.)&lt;/dd&gt;
&lt;dt&gt;Hole 6 (44)&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;sub {sub F{pop=~/[aeiou]/;$&amp;}sort{F($a)cmp F$b}@_}&lt;/code&gt;&lt;br&gt;
Which is not as cool as some, but is the best I could do without reading the thread.&lt;/dd&gt;&lt;/dl&gt;

This gives me an overall score of 155 for six holes, which I think is respectable...
&lt;p&gt;&lt;br&gt;&lt;hr&gt;&lt;i&gt;If God had meant us to fly, he would *never* have give us the railroads.&lt;br&gt;
           &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--Michael Flanders&lt;/i&gt;&lt;/p&gt;</field>
<field name="root_node">
82878</field>
<field name="parent_node">
82878</field>
</data>
</node>
