wolframscience.com

A New Kind of Science: The NKS Forum : Powered by vBulletin version 2.3.0 A New Kind of Science: The NKS Forum > Pure NKS > alife terminal screensaver
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
inhaesio zha


Registered: Oct 2005
Posts: 403

alife terminal screensaver

optimized for 80x25

main(){int a[4],i,q,r,s=1839,t,x,y,z[1920*sizeof(int)];for(x=0;x<1920*sizeof(
int);z[x]=0,x++);z[1000]=1;z[1001]=1;z[1080]=2;z[1081]=2;f:putchar('\n');for(i=
0;i<1920;i++){putchar(z[i]+32);a[0]=i%80>0?i-1:i+79;a[1]=i%80<79?i+1:i-79;a[2]=
i>79?i-80:s+i+1;a[3]=i<s?i+80:i-s-1;x=random()%4;y=random()%16;q=z[a[x]];r=z
[i];if(q){if(r==q)z[a[0]]=(r+y+q)%16;else if(r>q){t=(r*q)%16;z[a[x]]=r;z[i]=t;}
}else{z[a[x]]=r;z[i]=0;}}usleep(48000);goto f;}

Report this post to a moderator | IP: Logged

Old Post 12-17-2008 04:37 PM
inhaesio zha is offline Click Here to See the Profile for inhaesio zha Click here to Send inhaesio zha a Private Message Visit inhaesio zha's homepage! Edit/Delete Message Reply w/Quote
Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread


 

wolframscience.com  |  wolfram atlas  |  NKS online  |  Wolfram|Alpha  |  Wolfram Science Summer School  |  web resources  |  contact us

Forum Sponsored by Wolfram Research

© 2004-14 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. | Disclaimer | Archives