good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: ulam's spiral too slowby liverpole (Monsignor) |
on Apr 15, 2007 at 20:46 UTC ( [id://610227]=note: print w/replies, xml ) | Need Help?? |
++grinder, an excellent point.
My laziness in not optimizing it further has been revealed. As for counting by twos, I certainly could claim that my background gets the credit (I was a mathematics major), but I have to confess that many years ago I was the victim of a similar faux pas. I was taking a Pascal course in college (my first structure programming language -- best language ever -- until I learned "C" a few years later). The term project I had chosen was to create a program that generated patterns from prime numbers. I wrote a similar is_prime subroutine which counted by ones, and a friend who looked at my code said "you realize of course...". Whoops! s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|