Thread: pari break() usage View Single Post
2012-10-25, 03:40   #6
EdH

"Ed Hall"
Dec 2009

2×32×233 Posts

Quote:
 Originally Posted by Batalov 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: Code: 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.