<?xml version="1.0" encoding="windows-1252"?>
<node id="415348" title="Re: P2P Golf: MoleSter" created="2004-12-16 09:04:36" updated="2005-03-21 11:00:38">
<type id="11">
note</type>
<author id="85580">
dragonchild</author>
<data>
<field name="doctext">
It'd be nice to know how to test this w/o requiring another active P2P peer. That said, I found 10 characters, simply from syntax. If we didn't mind it being like 30 lines long, we could take advantage of newlines for another 15ish characters.
&lt;code&gt;
$p=shift;$a=a(shift);i(shift);socket S,2,1,6;bind S,$a;listen
S,5;undef$/;while(@ARGV&amp;&amp;($_="$p $a f".shift)||accept(C,S)&amp;&amp;($_=&lt;C&gt;)&amp;&amp;close
C){m!^(.*?) (.*?) ([e-i])([^/]*)/!s&amp;&amp;$1 eq$p&amp;&amp;&amp;$3($2,$4,$')}sub e{open
F,'&gt;',$_[1];print F $_[2];close F}sub f{t($_,@_)for keys%k}sub
g{open(F,'&lt;',$_[1])&amp;&amp; t($_[0],$a,"e$_[1]",&lt;F&gt;);close F}sub
h{t($_[0],$_,'i')for keys%k}sub i{$k{$_[0]}=1}sub
a{$_[0]=~/:/;pack'CxnC4x8',2,$',split'\.',$`}sub
t{socket X,2,1,6;$w=shift;if(connect X,a($w)){print X
"$p $_[0] $_[1]/$_[2]";close X}else{undef$k{$p}}}
&lt;/code&gt;
&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; This is what I just submitted back to the author. I think it ends up being 516 characters over 8 lines.
&lt;code&gt;
$/=$_;$(=shift;$a=shift;i(shift);socket S,2,1,6;bind S,a($a);listen
S,5;while(@ARGV&amp;&amp;($_="$( $a f".shift)||accept(C,S)&amp;&amp;($_=&lt;C&gt;)&amp;&amp;close
C){m!^(.*?) (.*?) ([e-i])([^/]*)/!s&amp;&amp;$(eq$1&amp;&amp;&amp;$3($2,$4,$')}sub f{t($_,@_)for
keys%k}sub a{pop=~/:/;pack'CxnC4x8',2,$',split'\.',$`}sub i{$k{$_[0]}=1}sub
g{open(F,"&lt;$_[1]")&amp;&amp; t($_[0],$a,"e$_[1]",&lt;F&gt;);close F}sub h{t($_[0],$_,'i')for
keys%k}sub t{socket X,2,1,6;if(connect X,a($w=shift)){print X
"$( $_[0] $_[1]/$_[2]";close X}else{undef$k{$w}}}sub
e{open F,"&gt;$_[1]";print F $_[2];close F}
&lt;/code&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-85580"&gt;
&lt;p align="center"&gt;&lt;i&gt;&lt;font size="-2"&gt;Being right, does not endow the right to be rude; politeness costs nothing.&lt;br&gt;Being unknowing, is not the same as being stupid.&lt;br&gt;Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.&lt;br&gt;Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
415203</field>
<field name="parent_node">
415203</field>
</data>
</node>
