### Re: Re: TPR(0,1) Golf Tournament Begins!

by Amoe (Friar)
 on Mar 01, 2002 at 17:55 UTC ( #148632=note: print w/replies, xml ) Need Help??

in reply to Re: TPR(0,1) Golf Tournament Begins!
in thread TPR(0,1) Golf Tournament Begins!

Heh...the experts are already way ahead of me, but as a beginner, I thought I'd try anyway. Apparently, 229 chars with very simple whitespace removal:

```my\$s=shift;until(length\$s<2){print"\$s\n";\$s=tpr(\$s)}print"\$s\n";sub
tpr{my@d=split//,shift;my \$s;while(my@p=splice@d,0,2){unshift@d,\$p[1]
unless!@d;my\$r=\$p[0]+\$p[1];until(\$r<=9){my\$c=\$r;\$r=0;for(split//,\$c){
\$r+=\$_}}\$s.=\$r}\$s}

Update: abuse of map brings it to 227. Is whitespace counted? I'd hate to make it a horrible one-line thing...

```my\$s=shift;until(length\$s<2){print"\$s\n";\$s=tpr(\$s)}print"\$s\n";sub
tpr{my@d=split//,shift;my \$s;while(my@p=splice@d,0,2){unshift@d,\$p[1]
unless!@d;my\$r=\$p[0]+\$p[1];until(\$r<10){my\$c=\$r;\$r=0;map{\$r+=\$_}split
//,\$c}\$s.=\$r}\$s}

--
my one true love

Create A New User
Node Status?
node history
Node Type: note [id://148632]
help
Chatterbox?
 [choroba]: Discipulus they probably knew why they wrote the code in C

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2017-10-23 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My fridge is mostly full of:

Results (280 votes). Check out past polls.

Notices?