sent to me by Sam Hurst
All I could figure out was that first it sets the entire 'f' array to '2000'.

Then it dumps out the digits in groups of 4. I played with the constants and they break things entirely. Don't know much else, least of all how you computer PI. But fun.

#include <stdio.h>

int a=10000,b,c=2800,d,e,f[2801],g;
main()
{
for(;b-c;)f[b++]=a/5;
for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
} 

-- MattWalsh - 31 May 2002

Topic revision: r1 - 31 May 2002 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback