#include stdlib.h #include string.h #ifndef TURBOC #define randomize() srand48(getpid()) #

---
Master Index Current Directory Index Go to SkepticTank Go to Human Rights activist Keith Henson Go to Scientology cult

Skeptic Tank!

#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

---

E-Mail Fredric L. Rice / The Skeptic Tank