> Insect  Program Breeding  Version B0.3a 06/04/1987 ( Author P.Bampton 2 BEEBUG May 1987 <" Program subject to copyright F: P"&87:A%=-P-&5100:A%<0:ThJ Z TVH d&81:xn(5),yn(5) n main x : main xi=12:yi=12:gxo=100:gyo=100 gx=18*xi:gy=17*yi+64 -A%=49:M%=1:N%=2:tm=&900:->1000:tm 512 !dna=tm+46:gen=dna+9*46:!gen=0 7$tm="100000000000001000000000001000000010000000000" $dna=43,"A") i=18:$(dna+i*46)=$dna: 19,1,6,0,0,0 19,0,7,0,0,0,19,3,0,0,0,0 grid ,28,26,31,39,0:131:0:12,28,26,31,39,0 newgen(A%-49) :0,4)"Generation ";!gen A%<>19 disgen "60,10)"Select 1-9 or"''"(L)oad (S)ave"'4"(Q)uit" ,0,8)"Breed from:"; 6:A%=:A%>95:A%=A%&DF @;"LSQ",A%)(A%>48A%<58):A%<64:A%:!gen=!gen+1:DhA JA%=81:0,15): TA%=76:load ^A%=83:save:DrA hi=08:clear(i): r24,0;0;1279;1023; |A%<64:TDA TNA  : bug(k,xp,yp,xj,yj):i,j .cxo=gxo+k 3*gx+xi:cyo=gyo+gy*2-k 3*gy+yi xj=xj 2:yj=yj 2  abdomen  thorax  head  legs  wings  : grid:yt,xt,i i=0 3*gy gy gxo,gyo+i:gxo+gx*3,gyo+i  &i=0 3*gx gx 0gxo+i,gyo:gxo+i,gyo+gy*3 : D 5:i=08 Nyt=gyo+3*gy-32-i 3*gy Xxt=gxo+gx 2-16+i 3*gx bxt,yt:i+49 l vgxo+6*xi,gyo+3*gy+48 " Breed a Bug" 4  : disgen:yt,xt,i '"Plotting...";  i=08 yt=gyo+3*gy-gy+yi-i 3*gy xt=gxo+xi+i 3*gx bug(i,xt,yt,xi,yi)  13;11;13;  :  ݤmut(a$):p,r,d p=((1)*(a$))+1  ($tm,p,1)="1" r=((1)*10) 9:DRC *(1)>0.5 d=N% d=-N% 4r=(a$,p,1))-65+d >r>16 r=16 H r<0 r=0 R"=a$,p-1)+(r+65)+a$,(a$)-p) \clear(n) fT24,gxo+n 3*gx+xi;gyo+gy*3-n 3*gy-gy+yi;gxo+n 3*gx+gx-xi;gyo+gy*3-n 3*gy-64; p: z: newgen(n):i,j  i=08 i=n dTC !$(dna+i*46)=mut($(dna+n*46)) M%<2 dTC  j=1M%-1 !$(dna+i*46)=mut($(dna+i*46)) j i  : abdomen:i,j,kk (xn(0)=gene(1) 10:yn(0)=gene(2) 4 $xn(1)=gene(3) (16-xn(0))+xn(0) $yn(1)=gene(4) (12-yn(0))+yn(0) 2xn(1)>0 xn(2)=xn(1)-gene(5) xn(1) xn(2)=0 $$yn(2)=gene(6) (15-yn(1))+yn(1) .$yn(3)=gene(7) (16-yn(2))+yn(2) 8cx=16*xj+cxo:cy=16*yj+cyo Bkk=1:i=12 L gc=3:g=gene(0) 4:g=2 gc=2 V g=3 gc=1 ` 0,gc jcx,cy:cx,cy-yn(0)*yj t j=02 ~"85,cx+kk*xn(j)*xj,cy-yn(j)*yj g=2 gc=5-gc  0,gc 85,cx,cy-yn(j+1)*yj  j:kk=-1 i: : (ݤgene(n):=($(dna+k*46),n+1,1))-65 thorax:i,j prethorax:kk=1  i=01 0,3 cx,cy:cx,cy+yn(0)*yj  j=01  "85,cx+kk*xn(j)*xj,cy+yn(j)*yj 85,cx,cy+yn(j+1)*yj  j:kk=-1 (i: 2: <prethorax Fxn(0)=gene(9) 10 Pyn(0)=gene(10) 8 Z%xn(1)=gene(11) (12-xn(0))+xn(0) d%yn(1)=gene(12) (10-yn(0))+yn(0) n%yn(2)=gene(13) (12-yn(1))+yn(1) xtw=xn(1):tl=yn(2)  : head:i,j prehead:kk=1  i=01 cx,cy+tl*yj cx,cy+yn(0)*yj  j=02 "85,cx+kk*xn(j)*xj,cy+yn(j)*yj 85,cx,cy+yn(j+1)*yj  j:kk=-1 i:antenna  :  prehead xn(0)=gene(15) 10 "yn(0)=gene(16) (13-tl)+tl ,%xn(1)=gene(17) (12-xn(0))+xn(0) 6%yn(1)=gene(18) (14-yn(0))+yn(0) @3xn(1)=0 xn(2)=0 xn(2)=xn(1)-gene(19) xn(1) J%yn(2)=gene(20) (15-yn(1))+yn(1) T%yn(3)=gene(21) (16-yn(2))+yn(2) ^hw=xn(1):hl=yn(2) h r: | antenna 'hw=0 xn(0)=0 xn(0)=gene(22) hw yn(0)=gene(23) (16-hl)+hl %xn(1)=gene(24) (12-xn(0))+xn(0) yn(1)=yn(0) %xn(2)=gene(25) (15-xn(1))+xn(1) yn(2)=yn(1)-gene(26) 15 kk=1:i=01 cx,cy+tl*yj  j=02 cx+kk*xn(j)*xj,cy+yn(j)*yj  j:kk=-1 i: :  legs:i htl=tl 2:g=gene(14) 3 xn(0)=gene(27) (13-tw)+tw &!yn(0)=gene(28) (13-htl)+htl 0yn(1)=htl-gene(29) 10 :%xn(1)=gene(30) (15-xn(0))+xn(0) D%yn(2)=gene(31) (15-yn(0))+yn(0) Nyn(3)=htl-gene(32) 5 X)yn(4)=yn(1)-gene(33) (15+htl-yn(1)) bkk=1 l i=01 vcx,cy+htl*yj cx+kk*xn(0)*xj,cy+yn(0)*yj cx+kk*xn(1)*xj,cy+yn(2)*yj cx,cy+htl*yj cx+kk*xn(0)*xj,cy+htl*yj cx+kk*xn(1)*xj,cy+yn(3)*yj cx,cy+htl*yj cx+kk*xn(0)*xj,cy+yn(1)*yj cx+kk*xn(1)*xj,cy+yn(4)*yj g<>0 dxG cx,cy+htl*yj 'cx+kk*xn(0)*xj,cy+(htl+yn(1))2*yj )cx+kk*xn(1)*xj,cy+(yn(3)+yn(4))2*yj  kk=-1:   :   7:=17 *::" at line "; 4 >: Hwings:i,j Rxn(0)=gene(35) (13-tw)+tw \!yn(0)=gene(36) (15-htl)+htl f%xn(1)=gene(37) (15-xn(0))+xn(0) p%yn(1)=yn(0)-gene(38) (12+yn(0)) zxn(2)=xn(1) %yn(2)=yn(1)-gene(39) (14+yn(1)) -xn(2)=0 xn(3)=0 xn(3)=gene(40) xn(2) %yn(3)=yn(2)-gene(41) (15+yn(2)) 3xn(3)=0 xn(4)=0 xn(4)=xn(3)-gene(42) xn(3) yn(4)=yn(3) (xn(5)=tw-1:yn(5)=htl-1:tw=0 xn(5)=0 g=gene(34) 9:g=0 gc=2:kp=85:g<3 gc=3  g>5 gc=1 (g=2)(g=4)(g=7) kp=5 0,gc:postwings 0,3  (g=5)(g=8) kp=5:postwings  : postwings:i,j $kk=1 . i=01 86cx+kk*tw*xj,cy+htl*yj:cx+kk*xn(5)*xj,cy+yn(5)*yj B"kp,cx+kk*xn(0)*xj,cy+yn(0)*yj L"kp,cx+kk*xn(0)*xj,cy+yn(1)*yj V"kp,cx+kk*xn(1)*xj,cy+yn(1)*yj `"kp,cx+kk*xn(2)*xj,cy+yn(2)*yj jkp,cx+kk*tw*xj,cy+yn(5)*yj t"kp,cx+kk*xn(3)*xj,cy+yn(3)*yj ~"kp,cx+kk*xn(4)*xj,cy+yn(4)*yj "kp,cx+xn(5)*xj*kk,cy+yn(5)*yj Hkp<>85 cx+kk*tw*xj,cy+htl*yj:j=05:cx+xn(j)*kk*xj,cy+yn(j)*yj:j kk=-1:i 0,3  : load !:'''"Load file"''"Filename" '":"F$:F$<>"":"LOAD "+F$+" "+~tm  : save !:'''"Save file"''"Filename" 3":"F$:F$<>"":"SAVE "+F$+" "+~tm+"+200 0 0"  : (S"Please wait";:B%=(+A%)-256:C%=P-:D%=0C%4:D%!B%=D%!::=B%:!&12=+C%: