10 ' Xenos.Bas 20 ' (C) 1983,1985 by Kevin A. Bjorke 30 ' 25724 Salceda Rd/Vlnca, CA 91355 40 ' CIS:74756,464 50 ' 60 dim mt(16,16),mv(254),xy(1,16,1):LN%=1:def fnkrak(p,q)=p/q+rv*(rnd(1)-.5) 70 scnclr:? "Planet Xenos":? "(C) 1983, 1985 KABjorke":? 80 ' input "Random # Seed:",sd%:randomize sd% 90 ask mouse a%,b%,c%:sd%=a%+b%:randomize sd% 100 ' input "Scale:",rc:screen 0,4,0:if rc=0 then rc=250 110 ?:?"[Left Mouse Button to continue]" 120 ask mouse a%,b%,c%:if c%<>4 then 120 130 rc=250:screen 0,4,0 140 pena 1:penb 1:peno 1:drawmode 1:box (0,0;319,199),1:pena 13 150 for a%=0 to 1+rnd(1)*4:b%=int(rnd(1)*4)+1:b2%=int(rnd(1)*310)+5:b3%=int(rnd(1)*130)+5 160 c%=int(rnd(1)*12)+2:pena c%:peno c%:circle (b2%,b3%),b%:paint(b2%,b3%),0:next a% 170 for a%= 1 to int(rnd(1)*200)+200:draw(int(rnd(1)*320),int(rnd(1)*199)),int(rnd(1)*10)+2:next a%:pena 14:peno 14 180 for a%=198 to 124 step -1:box(0,a%;319,199),1:next a%:draw (0,124 to 319,124),13 190 for l%=14 to 1 step -1:dx=320*(-l%):bc%=0:for r=-4 to 14:dy=(15-r)*320+900: if (dx+320)*900/dy < -320 then 390 200 if r>12 then n%=4 else if r>8 then n%=3 else if r%>4 then n%=2 else n%=1 210 n2%=2^n%:nm%=2^(4-n%):ns%=20*nm%:for c%=0 to 16 step nm%:mt(0,c%)=mv(bc%+c%\nm%):mt(c%,0)=mt(c%,16):next c%:if LN%<>n% then for c%=nm% to 16-nm% step 2*nm%:mt(c%,0)=(mt(c%-nm%,0)+mt(c%+nm%,0))/2:next c% 220 rv = rc:mt(16,16)=fnkrak(mt(16,0)+mt(0,16),2) 230 for c%=1 to n%:c2%=2^c%:cm%=2^(4-c%):c3%=2*cm%:rv=rc/c2% 240 for d%=cm% to 16 step c3%:dd%=d%-cm%:du%=d%+cm% 250 for e%=cm% to 16 step c3%:ed%=e%-cm%:eu%=e%+cm% 260 mt(du%,e%)=fnkrak(mt(du%,ed%)+mt(du%,eu%),2):mt(d%,eu%)=fnkrak(mt(dd%,eu%)+mt(du%,eu%),2) 270 mt(d%,e%)=fnkrak(mt(dd%,ed%)+mt(dd%,eu%)+mt(du%,ed%)+mt(du%,eu%),4): next e%,d%,c% 280 ' 290 for a%=0 to 16 step nm%:mc=900/((16-a%)*20+dy):sp=ns%*mc:px=320+dx*mc:py=126+100*mc 300 for b%=0 to 16 step nm%:b2%=b%-nm%:for c%=0 to 1:xy(1,b%,c%)=xy(0,b%,c%):next c% 310 xy(0,b%,0)=px:if mt(b%,a%)>0 then xy(0,b%,1)=py-mt(b%,a%)*mc else xy(0,b%,1)=py 320 if b%=0 or a%=0 or xy(0,b%,0)<0 then 370 330 if mt(b%,a%)<=0 and mt(b2%,a%)<=0 then draw(xy(0,b%,0),xy(0,b%,1);xy(0,b2%,0),xy(0,b2%,1)),0:goto 370 340 if xy(0,b2%,1)>xy(1,b2%,1) and xy(0,b%,1)>xy(1,b%,1) then 370 350 area (xy(0,b%,0),199 to xy(0,b2%,0),199 to xy(0,b2%,0),xy(0,b2%,1) to xy(0,b%,0),xy(0,b%,1)) 360 draw (xy(0,b2%,0),xy(0,b2%,1) to xy(0,b%,0),xy(0,b%,1)),13 370 px=px+sp:next b%,a% 380 for c%=0 to 16 step nm%:mv(bc%)=mt(16,c%):bc%=bc%+1:next c%:LN%=n%:next r 390 for c%=0 to 16:mt(c%,16)=0:next c%,l% 395 ask mouse a%,b%,c%:if c%=4 then 395 400 ask mouse a%,b%,c%:if c%=0 then 400 410 scnclr:goto 140 420 ' 430 ' eof