There's more than one way to do things 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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-22 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
World peace can best be achieved by:

Results (163 votes). Check out past polls.

Notices?