---

#include #include #ifndef __TURBOC__ #define randomize() srand48(getpid()) #define random(x) (lrand48() % x) #endif #define MAXSTRING 128 #define MAXCREATURE 100 #define MAXCHAR 96 char ecology[MAXCREATURE][MAXSTRING]; int score[MAXCREATURE],mutate=10,swran=(MAXCHAR/2); int dist(char *one,char *other){ int index,wide; wide=0; for(index=0;(one[index]!=0) && (other[index]!=0);++index) wide+=abs(one[index]-other[index]); return(wide); } void makeran(int who,int length){ int index; for(index=0;index0;--index1){ for(index2=0;index2score[index2+1]) mswap(index2,index2+1); } } char alter(char this){ unsigned char new; if(this==0) return(0); if(random(mutate)) return(this); if(this<35) new=this+MAXCHAR-35; else new=this-35; new=((new+random(7)) % MAXCHAR)+32; if(new<32) puts("I screwed up"); return(new); } void combine(int first,int second,int to){ int index,guy=first; for(index=0;index(MAXCREATURE/2)) for(index=maxkeep;index

---

The views and opinions stated within this web page are those of the author or authors which wrote them and may not reflect the views and opinions of the ISP or account user which hosts the web page. The opinions may or may not be those of the Chairman of The Skeptic Tank.

Return to The Skeptic Tank's main Index page.

E-Mail Fredric L. Rice / The Skeptic Tank