View Single Post
Old 2012-10-25, 03:40   #6
EdH's Avatar
"Ed Hall"
Dec 2009
Adirondack Mtns

2×32×233 Posts

Originally Posted by Batalov View Post
Oh, I do it myself all the time. When I prototype PE problems in Pari, I frequently type a monstrous ever-growing one-liner (without indentation, obviously). It's a pain to watch later. Here's an example:
forprime(p=2,10000,if(p%10==1||p%10==9,d=divisors(p-1);for(j=2,#d,i=d[j]*p;if(i>10^8,break);if(fibonacci(i)%p^2==0,write("presieve1",p" "i);break))))
(I rewrote it in C, later; Not only rewrote much prettier but without even touching fibonacci(); this was just brainstorming -- Uggggh!)
I used to write stuff like that in a single cell in Excel - I kept bumping up against the character limit. I still have a scoring workbook in use in several places across the country that won't work with greater than 999 competitors due to the cell limitation (unless newer versions expanded that limit). I've been trying to clean my code up lately, what code I still write. Someday, I have to actually comment things. I've run into the problem of not being able to read my own code for lack of comments.

Hmm... I'm rambling... Gotta go.

Thanks again.
EdH is offline   Reply With Quote