P is for Practical PerlMonks

### Re: (Efficiency Golf) Triangular numbers

by tachyon (Chancellor)
 on May 30, 2001 at 16:03 UTC ( #84228=note: print w/replies, xml ) Need Help??

in reply to (Efficiency Golf) Triangular numbers

For those who are impatient I ran my code through the obfu engine...

tachyon

```my\$time=time();local\$";map{\$t{.5*\$_*(\$_+1)}=1}1..446;map{
push@p,\$1 if/(...(.)\2)/}keys%t;map{@a[0..3]=split'';map{
push@p1,"@a\$_"if defined\$t{"\$a[0]\$a[3]\$_"}}0..9}@p;map{@a
=split'';map{push@p2,"@a\$_"if defined\$t{"\$_\$a[4]\$a[3]"}}
0..9}@p1;map{/(.)(.)(.)(.)(.)(.)/;push @p3,\$_ if/[^\$2\$3\$4
\$5\$6][^\$1\$3\$4\$5\$6][^\$1\$2\$4\$5\$6][^\$1\$2\$3\$5\$6][^\$1\$2\$3\$4\$6]
[^\$1\$2\$3\$4\$5]/x;}@p2;for(@p3){\$r='0123456789';\$r=~s/\$_//
for split'';@r=split'',\$r;for\$a(@r){for\$b(@r){next if\$b==
\$a;for\$c(@r){next if\$c==\$b or\$c==\$a;if(defined\$t{"\$a\$b\$c"})
{@a=split'';\$w="one:\$a[5]\$a[4]\$a[3] three:\$a[0]\$a[1]\$a[2]"
."\$a[3]\$a[3] six:\$a\$b\$c ten:\$a[0]\$a[3]\$a[4]\n"}}}}}\$time=
time()-\$time;print\$w."Elapsed time \$time seconds\n";

Create A New User
Node Status?
node history
Node Type: note [id://84228]
help
Chatterbox?
 [james28909]: james28909... failer of the chatterbox [james28909]: :D

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-05-24 23:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favorite model of computation is ...

Results (186 votes). Check out past polls.