Beefy Boxes and Bandwidth Generously Provided by pair Networks
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";


Comment on Re: (Efficiency Golf) Triangular numbers
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://84228]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-07-28 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (186 votes), past polls