Home » Personal collection » Acorn ADFS disks » Archimedes » Dominic_4.ADF » BioBot/BBReal2

BioBot/BBReal2

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Archimedes » Dominic_4.ADF
Filename: BioBot/BBReal2
Read OK:
File size: 1D09 bytes
Load address: FFFFFB45
Exec address: BC76ACBE
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10 REM BallBot V2.0
   20 REM Real-Time Version
   30 REM (C) Dominic Ford 1997
   40 :
   50 REM Welcome screen
   60 MODE6:PRINT" BallBot Artificial Intelligence Module"'"Simulation Tester V2.0 Real Time Version"''"Programmed and Designed by Dominic Ford"''SPC(16);"(C) 1997"
   70 PRINT'''"Press <SPACE>"
   80 REPEAT UNTIL INKEY(-99)
   90 :
  100 REM Setup variables
  110 VOICE 1,"StringLib-Soft":*STEREO 1 0
  120 VOICE 2,"StringLib-Soft":*STEREO 2 -127
  130 VOICE 3,"StringLib-Soft":*STEREO 3 127
  140 current=0:DIMball(4,1):bbx=640:bby=950:dir=270:PROCsetupbb
  150 MODE15:MOUSE ON:PROCdrawfull
  160 :
  170 REM Start main loop
  180 REPEAT:T=TIME
  190 PROCuser
  200 IF idle THEN UNTIL FALSE
  210 PROCsense
  220 mov=FNai(freqa,freqb,freqc)
  230 fwd=(mov AND 1)<>0
  240 reverse=(mov AND 2)<>0
  250 left=(mov AND 4)<>0
  260 right=(mov AND 8)<>0
  270 turbo=(mov AND 16)<>0
  280 PROCmoveit
  290 REPEAT UNTIL TIME>(T+15)
  300 UNTIL FALSE
  310 :
  320 REM Graphic interface
  330 DEFPROCdrawfull
  340 REM Set up constants
  350 LOCALsx,sy,width
  360 sx=1:sy=2:width=10
  370 REM Draw green court area
  380 CLS:GCOL0,%001100:RECTANGLE FILL 0,0,1279,1023
  390 REM Mark out white lines onto court
  400 GCOL0,%111111:RECTANGLE FILL sx/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width:RECTANGLE FILL sx/(23.77+2*sx)*1280,(1.37+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width
  410 RECTANGLE FILL sx/(23.77+2*sx)*1280,(9.6+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width:RECTANGLE FILL sx/(23.77+2*sx)*1280,(10.97+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width
  420 RECTANGLE FILL (sx+5.47)/(23.77+2*sx)*1280,(sy+5.49)/(10.97+2*sy)*1024,12.8/(23.77+2*sx)*1280,width
  430 RECTANGLE FILL sx/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,width,10.97/(10.97+2*sy)*1024:RECTANGLE FILL (sx+23.77)/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,width,10.97/(10.97+2*sy)*1024+width
  440 RECTANGLE FILL (sx+5.47)/(23.77+2*sx)*1280,(sy+1.37)/(10.97+2*sy)*1024,width,8.23/(10.97+2*sy)*1024:RECTANGLE FILL (sx+18.3)/(23.77+2*sx)*1280,(sy+1.37)/(10.97+2*sy)*1024,width,8.23/(10.97+2*sy)*1024
  450 :
  460 REM Draw net
  470 GCOL0,0:FORl=100TO924STEP10:MOVE 640,l:DRAW 680,l+50:NEXT:FORl=0TO40STEP10:MOVE 640+l,100+l:DRAW640+l,924+l:NEXT:FORl=0TO5:MOVE637+l,100:DRAW677+l,150:MOVE637+l,924:DRAW677+l,974:NEXT
  480 GCOL0,%111111:MOVE 682,142:DRAW682,966
  490 PROCdrawmini
  500 ENDPROC
  510 :
  520 REM Draw ballbot and balls
  530 DEFPROCdrawmini
  540 GCOL3,1:FORb=0TO4
  550 IF ball(b,0)<>0 OR ball(b,1)<>0 THEN RECTANGLE FILL ball(b,0),ball(b,1),5,5
  560 NEXT
  570 GCOL3,%110000:RECTANGLE FILL bbx,bby,5,5
  580 ENDPROC
  590 :
  600 REM User interface (putting balls down)
  610 DEFPROCuser
  620 MOUSE x,y,c
  630 IF c=0 THEN ENDPROC
  640 IF (c AND 4)<>0 THEN PROCdrawmini:ball(current,0)=x:ball(current,1)=y:current=(current+1)MOD5:PROCdrawmini
  650 IF (c AND 2)<>0 THEN idle=FALSE:stage=0:start=TIME
  660 REPEAT
  670 MOUSE x,y,c
  680 UNTIL c=0
  690 ENDPROC
  700 :
  710 REM Calculate ballbot's new position
  720 DEFPROCmoveit
  730 IF (left AND fwd) OR (right AND reverse) THEN dir=dir-2.5*(1+3*turbo)
  740 IF (right AND fwd) OR (left AND reverse) THEN dir=dir+2.5*(1+3*turbo)
  750 :
  760 REM Get direction in range 0<theta<360
  770 REPEAT IF dir<0 THEN dir=dir+360
  780 IF dir>=360 THEN dir=dir-360
  790 UNTIL dir>=0 AND dir<360
  800 :
  810 fr=0:IF fwd THEN fr=fr+0.25
  820 IF reverse THEN fr=fr-0.25
  830 IF turbo THEN fr=fr*4
  840 PROCdrawmini:bbx=bbx+16*SIN(PI*dir/180)*fr
  850 bby=bby+16*COS(PI*dir/180)*fr
  860 FORball=0TO4:IF ABS(bbx-ball(ball,0))<10 AND ABS(bby-ball(ball,1))<10 THEN ball(ball,0)=0
  870 NEXT:PROCdrawmini
  880 ENDPROC
  890 :
  900 REM Calculate ballbot's background echo reading (-balls)
  910 DEFFNback(x,y,freq)
  920 REM Calculate Angle of net as seen by Ballbot
  930 LOCAL freqa
  940 netlow=(FNangle(640,923,x,y)-dir) MOD 360
  950 IF netlow<0 THEN netlow=netlow+360
  960 IF netlow>180 THEN netlow=netlow-360
  970 nethi=(FNangle(640,100,x,y)-dir) MOD 360
  980 IF nethi<0 THEN nethi=nethi+360
  990 IF nethi>180 THEN nethi=nethi-360
 1000 :
 1010 REM Calculate reading
 1020 freqa=freq+RND(6)-3
 1030 IF ABS(SIN(PI*dir/180))>0.01 THEN IF ((netlow<0 AND nethi>0) OR (nethi<0 AND netlow>0)) AND (640-x)/SIN(PI*dir/180)>0 THEN freqa=(640-x)/SIN(PI*dir/180)
 1040 =freqa
 1050 :
 1060 REM Calculate Ballbot's readings (MAIN ROUTINE)
 1070 :
 1080 DEFPROCsense
 1090 REM Get background readings from FNback
 1100 freq=RND(250)+1500:fa$="U":fb$=fa$:fc$=fa$:fd$=fa$
 1110 freqa=FNback(bbx,bby,freq)
 1120 dir=dir-30:freqb=FNback(bbx,bby,freq)
 1130 dir=dir+60:freqc=FNback(bbx,bby,freq)
 1140 dir=dir-105:freqd=FNback(bbx,bby,freq):dir=dir+75
 1150 :
 1160 REM Add any relevant balls to readings (using hairy trigonometry)
 1170 :
 1180 FORball=0TO4
 1190 d%=SQR((ball(ball,0)-bbx)^2+(ball(ball,1)-bby)^2)
 1200 IF ball(ball,0)=0 THEN d%=9999
 1210 a=FNangle(ball(ball,0),ball(ball,1),bbx,bby)-dir
 1220 IF ABS(a)<15 AND freqa>d% THEN freqa=d%:fa$="B"
 1230 IF a>-46 AND a<=-15 AND freqb>d% THEN freqb=d%:fb$="B"
 1240 IF a>=15 AND a<46 AND freqc>d% THEN freqc=d%:fc$="B"
 1250 IF a>-90 AND a<=-46 AND freqd>d% THEN freqd=d%:fd$="B"
 1260 NEXT
 1270 :
 1280 REM Update user displays
 1290 :
 1300 PRINTTAB(0,0)INT((TIME-start)/6000);":";(INT((TIME-start)/100)MOD60)
 1310 PRINTTAB(0,31)INT(freqd),INT(freqb),INT(freqa),INT(freqc),stage,INT(searching),left,right;
 1320 SOUND 1,-1,freqa/4,5:SOUND 2,-1,freqb/4,5:SOUND 3,-1,freqc/4,5
 1330 ENDPROC
 1340:
 1350 REM Calculate bearing of B from A
 1360 DEFFNangle(x1,y1,x2,y2)
 1370 IF y2=y1 THEN ang=90 ELSE ang=180*ATN((x2-x1)/(y2-y1))/PI
 1380 IF (y2>y1) THEN ang=ang+180
 1390 IF ang<0 THEN ang=ang+360
 1400 =ang MOD 360
 1410 :
 1420 REM BALLBOT ROBOTIC INTELLIGENCE MODULE
 1430 :
 1440 DEFFNai(freqa,freqb,freqc)
 1450 REM Artificial intelligence routines (ie. What Next??)
 1460 LOCALfwd,reverse,left,right,turbo
 1470 fwd=TRUE:reverse=FALSE:left=FALSE:right=FALSE:turbo=FALSE
 1480 :
 1490 REM What stage are we in? Hunt for balls or move to new area?
 1500 IF near<>0 AND stage<8 THEN PROCdonearstuff
 1510 IF near=0 AND (stage=0 OR stage=2) THEN PROChunt
 1520 IF near=0 AND (stage=1 OR stage=3) THEN PROCmoveout
 1530 IF stage=4 THEN PROCreleaseb
 1540 :
 1550 REM Prepare output into binary for transmission
 1560 feed=0:IF fwd THEN feed=feed+1
 1570 IF reving THEN turbo=TRUE
 1580 IF reverse THEN feed=feed+2
 1590 IF left THEN feed=feed+4
 1600 IF right THEN feed=feed+8
 1610 IF turbo THEN feed=feed+16
 1620 =feed
 1630 :
 1640 REM Perform a sweep to find any balls
 1650 DEFPROChunt
 1660 REM Watch out if too near to net
 1670 IF((freqa<20AND fa$<>"B")OR(freqb<20AND fb$<>"B")OR(freqc<20AND fc$<>"B"))OR(reving AND((freqa<150AND fa$<>"B")OR(freqb<150AND fb$<>"B")OR(freqc<150AND fc$<>"B")))THENreving=TRUE:reverse=TRUE:fwd=FALSE:left=FALSE:right=FALSE:ENDPROC
 1680 reving=FALSE
 1690 :
 1700 REM If Ball is out of reach in the "D" sector, reverse!
 1710 FDR=freqd*1.25:IF fd$="B" AND FDR<freqa AND FDR<freqb AND FDR<freqc AND (fa$<>"B" OR freqa>100) AND (fb$<>"B" OR freqb>100) AND (fc$<>"B" OR freqc>100) THEN reverse=TRUE:fwd=FALSE:right=TRUE:farleft=6:ENDPROC
 1720 IF farleft>0 THEN farleft=farleft-1:reverse=TRUE:fwd=FALSE:right=TRUE:ENDPROC
 1730 :
 1740 REM Rotate to face ball
 1750 IF fa$="B" THEN searching=searching/2:turbo=freqa>100:ENDPROC
 1760 IF fb$="B" THEN left=TRUE:ENDPROC
 1770 IF fc$="B" THEN right=TRUE:ENDPROC
 1780 REM If no ball in sight, continue rotation...
 1790 align=FALSE:searching=searching+1:IF searching<5 THEN right=TRUE ELSE left=TRUE
 1800 IF searching>150 THEN stage=stage+1
 1810 ENDPROC
 1820 :
 1830 REM Find edge of net and aim for it to move to other side
 1840 DEFPROCmoveout
 1850 REM Watch out if too near to net
 1860 IF (freqa<30 OR freqb<30 OR freqc<30) OR (reving AND (freqa<125 OR freqb<125 OR freqc<125)) THEN reving=TRUE:reverse=TRUE:fwd=FALSE:left=FALSE:right=FALSE:ENDPROC
 1870 reving=FALSE
 1880 REM Align ballbot to face the net post...
 1890 IF freqd<75 THEN right=TRUE:turbo=TRUE:ENDPROC
 1900 IF freqa<350 THEN right=TRUE:ENDPROC
 1910 IF freqb<60 AND freqa>200 THEN right=TRUE:near=1:ENDPROC
 1920 IF freqa<200 AND freqb<200 AND freqc<200 THEN right=TRUE:ENDPROC
 1930 IF (freqb*1.5)>freqc THEN left=TRUE:ENDPROC
 1940 IF freqb>100 THEN turbo=TRUE
 1950 ENDPROC
 1960 :
 1970 REM Nearly there... Just need a little nudge in the right direction.
 1980 DEFPROCdonearstuff
 1990 near=near+1
 2000 IF near<8 THEN right=TRUE:ENDPROC
 2010 left=TRUE
 2020 IF near>16 THEN near=0:stage=stage+1:searching=0
 2030 ENDPROC
 2040 :
 2050 REM Initialise BallBot variables at the beginning of a run
 2060 DEFPROCsetupbb
 2070 reving=FALSE:left=FALSE:right=FALSE:fwd=FALSE:reverse=FALSE:searching=0:idle=TRUE
 2080 near=FALSE:farleft=0
 2090 ENDPROC
 2100 :
 2110 DEFPROCreleaseb
 2120 REM Got all the balls, now just dump them!
 2130 near=near+1:reverse=TRUE:fwd=FALSE
 2140 IF near>9 THEN idle=TRUE:near=FALSE
 2150 ENDPROC
 2160 REPEAT:FORX=1TO12:OSCLI"CHANNELVOICE 1 "+STR$X:SOUND1,-10,52,100:FORR=0TO10000:NEXT,:UNTIL FALSE

 � BallBot V2.0
 � Real-Time Version
 � (C) Dominic Ford 1997
( :
2 � Welcome screen
<� �6:�" BallBot Artificial Intelligence Module"'"Simulation Tester V2.0 Real Time Version"''"Programmed and Designed by Dominic Ford"''�(16);"(C) 1997"
F �'''"Press <SPACE>"
P � � �(-99)
Z :
d � Setup variables
n& ȡ 1,"StringLib-Soft":*STEREO 1 0
x) ȡ 2,"StringLib-Soft":*STEREO 2 -127
�( ȡ 3,"StringLib-Soft":*STEREO 3 127
�: current=0:�ball(4,1):bbx=640:bby=950:dir=270:�setupbb
� �15:ȗ �:�drawfull
� :
� � Start main loop
�
 �:T=�
�
 �user
� � idle � � �
� �sense
� mov=�ai(freqa,freqb,freqc)
� fwd=(mov � 1)<>0
� reverse=(mov � 2)<>0
� left=(mov � 4)<>0
 right=(mov � 8)<>0
 turbo=(mov � 16)<>0
 �moveit
" � � �>(T+15)
, � �
6 :
@ � Graphic interface
J ��drawfull
T � Set up constants
^ �sx,sy,width
h sx=1:sy=2:width=10
r � Draw green court area
|% �:�0,%001100:ȓ Ȑ 0,0,1279,1023
�& � Mark out white lines onto court
�� �0,%111111:ȓ Ȑ sx/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width:ȓ Ȑ sx/(23.77+2*sx)*1280,(1.37+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width
�� ȓ Ȑ sx/(23.77+2*sx)*1280,(9.6+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width:ȓ Ȑ sx/(23.77+2*sx)*1280,(10.97+sy)/(10.97+2*sy)*1024,23.77/(23.77+2*sx)*1280,width
�_ ȓ Ȑ (sx+5.47)/(23.77+2*sx)*1280,(sy+5.49)/(10.97+2*sy)*1024,12.8/(23.77+2*sx)*1280,width
�� ȓ Ȑ sx/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,width,10.97/(10.97+2*sy)*1024:ȓ Ȑ (sx+23.77)/(23.77+2*sx)*1280,sy/(10.97+2*sy)*1024,width,10.97/(10.97+2*sy)*1024+width
�� ȓ Ȑ (sx+5.47)/(23.77+2*sx)*1280,(sy+1.37)/(10.97+2*sy)*1024,width,8.23/(10.97+2*sy)*1024:ȓ Ȑ (sx+18.3)/(23.77+2*sx)*1280,(sy+1.37)/(10.97+2*sy)*1024,width,8.23/(10.97+2*sy)*1024
� :
� � Draw net
։ �0,0:�l=100�924�10:� 640,l:� 680,l+50:�:�l=0�40�10:� 640+l,100+l:�640+l,924+l:�:�l=0�5:�637+l,100:�677+l,150:�637+l,924:�677+l,974:�
�" �0,%111111:� 682,142:�682,966
� �drawmini
� �
� :
 � Draw ballbot and balls
 ��drawmini
 �3,1:�b=0�4
&B � ball(b,0)<>0 � ball(b,1)<>0 � ȓ Ȑ ball(b,0),ball(b,1),5,5
0 �
:! �3,%110000:ȓ Ȑ bbx,bby,5,5
D �
N :
X* � User interface (putting balls down)
b ��user
l
 ȗ x,y,c
v � c=0 � �
�a � (c � 4)<>0 � �drawmini:ball(current,0)=x:ball(current,1)=y:current=(current+1)�5:�drawmini
�* � (c � 2)<>0 � idle=�:stage=0:start=�
� �
�
 ȗ x,y,c
�
 � c=0
� �
� :
�' � Calculate ballbot's new position
�
 ��moveit
�A � (left � fwd) � (right � reverse) � dir=dir-2.5*(1+3*turbo)
�A � (right � fwd) � (left � reverse) � dir=dir+2.5*(1+3*turbo)
� :
�) � Get direction in range 0<theta<360
 � � dir<0 � dir=dir+360
 � dir>=360 � dir=dir-360
 � dir>=0 � dir<360
  :
* fr=0:� fwd � fr=fr+0.25
4 � reverse � fr=fr-0.25
> � turbo � fr=fr*4
H) �drawmini:bbx=bbx+16*�(�*dir/180)*fr
R bby=bby+16*�(�*dir/180)*fr
\Q �ball=0�4:� �(bbx-ball(ball,0))<10 � �(bby-ball(ball,1))<10 � ball(ball,0)=0
f �:�drawmini
p �
z :
�; � Calculate ballbot's background echo reading (-balls)
� ݤback(x,y,freq)
�0 � Calculate Angle of net as seen by Ballbot
� � freqa
�+ netlow=(�angle(640,923,x,y)-dir) � 360
�# � netlow<0 � netlow=netlow+360
�% � netlow>180 � netlow=netlow-360
�* nethi=(�angle(640,100,x,y)-dir) � 360
�  � nethi<0 � nethi=nethi+360
�" � nethi>180 � nethi=nethi-360
� :
� � Calculate reading
� freqa=freq+�(6)-3
� � �(�(�*dir/180))>0.01 � � ((netlow<0 � nethi>0) � (nethi<0 � netlow>0)) � (640-x)/�(�*dir/180)>0 � freqa=(640-x)/�(�*dir/180)
 =freqa
 :
$2 � Calculate Ballbot's readings (MAIN ROUTINE)
. :
8 ��sense
B* � Get background readings from FNback
L5 freq=�(250)+1500:fa$="U":fb$=fa$:fc$=fa$:fd$=fa$
V freqa=�back(bbx,bby,freq)
`) dir=dir-30:freqb=�back(bbx,bby,freq)
j) dir=dir+60:freqc=�back(bbx,bby,freq)
t5 dir=dir-105:freqd=�back(bbx,bby,freq):dir=dir+75
~ :
�D � Add any relevant balls to readings (using hairy trigonometry)
� :
� �ball=0�4
�4 d%=�((ball(ball,0)-bbx)^2+(ball(ball,1)-bby)^2)
� � ball(ball,0)=0 � d%=9999
�4 a=�angle(ball(ball,0),ball(ball,1),bbx,bby)-dir
�, � �(a)<15 � freqa>d% � freqa=d%:fa$="B"
�3 � a>-46 � a<=-15 � freqb>d% � freqb=d%:fb$="B"
�1 � a>=15 � a<46 � freqc>d% � freqc=d%:fc$="B"
�3 � a>-90 � a<=-46 � freqd>d% � freqd=d%:fd$="B"
� �
� :
 � Update user displays

 :
6 �0,0)�((�-start)/6000);":";(�((�-start)/100)�60)
N �0,31)�(freqd),�(freqb),�(freqa),�(freqc),stage,�(searching),left,right;
(7 � 1,-1,freqa/4,5:� 2,-1,freqb/4,5:� 3,-1,freqc/4,5
2 �
<:
F$ � Calculate bearing of B from A
P ݤangle(x1,y1,x2,y2)
Z4 � y2=y1 � ang=90 � ang=180*�((x2-x1)/(y2-y1))/�
d � (y2>y1) � ang=ang+180
n � ang<0 � ang=ang+360
x =ang � 360
� :
�* � BALLBOT ROBOTIC INTELLIGENCE MODULE
� :
� ݤai(freqa,freqb,freqc)
�9 � Artificial intelligence routines (ie. What Next??)
�" �fwd,reverse,left,right,turbo
�+ fwd=�:reverse=�:left=�:right=�:turbo=�
� :
�@ � What stage are we in? Hunt for balls or move to new area?
�' � near<>0 � stage<8 � �donearstuff
�+ � near=0 � (stage=0 � stage=2) � �hunt
�. � near=0 � (stage=1 � stage=3) � �moveout
� � stage=4 � �releaseb
 :
2 � Prepare output into binary for transmission
 feed=0:� fwd � feed=feed+1
" � reving � turbo=�
, � reverse � feed=feed+2
6 � left � feed=feed+4
@ � right � feed=feed+8
J � turbo � feed=feed+16
T
 =feed
^ :
h( � Perform a sweep to find any balls
r ��hunt
|# � Watch out if too near to net
�� �((freqa<20� fa$<>"B")�(freqb<20� fb$<>"B")�(freqc<20� fc$<>"B"))�(reving �((freqa<150� fa$<>"B")�(freqb<150� fb$<>"B")�(freqc<150� fc$<>"B")))�reving=�:reverse=�:fwd=�:left=�:right=�:�
�
 reving=�
� :
�: � If Ball is out of reach in the "D" sector, reverse!
�� FDR=freqd*1.25:� fd$="B" � FDR<freqa � FDR<freqb � FDR<freqc � (fa$<>"B" � freqa>100) � (fb$<>"B" � freqb>100) � (fc$<>"B" � freqc>100) � reverse=�:fwd=�:right=�:farleft=6:�
�> � farleft>0 � farleft=farleft-1:reverse=�:fwd=�:right=�:�
� :
� � Rotate to face ball
�8 � fa$="B" � searching=searching/2:turbo=freqa>100:�
� � fb$="B" � left=�:�
� � fc$="B" � right=�:�
�0 � If no ball in sight, continue rotation...
�C align=�:searching=searching+1:� searching<5 � right=� � left=�
$ � searching>150 � stage=stage+1
 �
 :
&< � Find edge of net and aim for it to move to other side
0 ��moveout
:# � Watch out if too near to net
D� � (freqa<30 � freqb<30 � freqc<30) � (reving � (freqa<125 � freqb<125 � freqc<125)) � reving=�:reverse=�:fwd=�:left=�:right=�:�
N
 reving=�
X, � Align ballbot to face the net post...
b# � freqd<75 � right=�:turbo=�:�
l � freqa<350 � right=�:�
v. � freqb<60 � freqa>200 � right=�:near=1:�
�4 � freqa<200 � freqb<200 � freqc<200 � right=�:�
�# � (freqb*1.5)>freqc � left=�:�
� � freqb>100 � turbo=�
� �
� :
�G � Nearly there... Just need a little nudge in the right direction.
� ��donearstuff
� near=near+1
� � near<8 � right=�:�
� left=�
�1 � near>16 � near=0:stage=stage+1:searching=0
� �
� :
= � Initialise BallBot variables at the beginning of a run
 ��setupbb
? reving=�:left=�:right=�:fwd=�:reverse=�:searching=0:idle=�
  near=�:farleft=0
* �
4 :
> ��releaseb
H- � Got all the balls, now just dump them!
R  near=near+1:reverse=�:fwd=�
\ � near>9 � idle=�:near=�
f �
pD �:�X=1�12:�"CHANNELVOICE 1 "+�X:�1,-10,52,100:�R=0�10000:�,:� �
�
00000000  0d 00 0a 13 20 f4 20 42  61 6c 6c 42 6f 74 20 56  |.... . BallBot V|
00000010  32 2e 30 0d 00 14 18 20  f4 20 52 65 61 6c 2d 54  |2.0.... . Real-T|
00000020  69 6d 65 20 56 65 72 73  69 6f 6e 0d 00 1e 1c 20  |ime Version.... |
00000030  f4 20 28 43 29 20 44 6f  6d 69 6e 69 63 20 46 6f  |. (C) Dominic Fo|
00000040  72 64 20 31 39 39 37 0d  00 28 06 20 3a 0d 00 32  |rd 1997..(. :..2|
00000050  15 20 f4 20 57 65 6c 63  6f 6d 65 20 73 63 72 65  |. . Welcome scre|
00000060  65 6e 0d 00 3c 9a 20 eb  36 3a f1 22 20 42 61 6c  |en..<. .6:." Bal|
00000070  6c 42 6f 74 20 41 72 74  69 66 69 63 69 61 6c 20  |lBot Artificial |
00000080  49 6e 74 65 6c 6c 69 67  65 6e 63 65 20 4d 6f 64  |Intelligence Mod|
00000090  75 6c 65 22 27 22 53 69  6d 75 6c 61 74 69 6f 6e  |ule"'"Simulation|
000000a0  20 54 65 73 74 65 72 20  56 32 2e 30 20 52 65 61  | Tester V2.0 Rea|
000000b0  6c 20 54 69 6d 65 20 56  65 72 73 69 6f 6e 22 27  |l Time Version"'|
000000c0  27 22 50 72 6f 67 72 61  6d 6d 65 64 20 61 6e 64  |'"Programmed and|
000000d0  20 44 65 73 69 67 6e 65  64 20 62 79 20 44 6f 6d  | Designed by Dom|
000000e0  69 6e 69 63 20 46 6f 72  64 22 27 27 89 28 31 36  |inic Ford"''.(16|
000000f0  29 3b 22 28 43 29 20 31  39 39 37 22 0d 00 46 18  |);"(C) 1997"..F.|
00000100  20 f1 27 27 27 22 50 72  65 73 73 20 3c 53 50 41  | .'''"Press <SPA|
00000110  43 45 3e 22 0d 00 50 0f  20 f5 20 fd 20 a6 28 2d  |CE>"..P. . . .(-|
00000120  39 39 29 0d 00 5a 06 20  3a 0d 00 64 16 20 f4 20  |99)..Z. :..d. . |
00000130  53 65 74 75 70 20 76 61  72 69 61 62 6c 65 73 0d  |Setup variables.|
00000140  00 6e 26 20 c8 a1 20 31  2c 22 53 74 72 69 6e 67  |.n& .. 1,"String|
00000150  4c 69 62 2d 53 6f 66 74  22 3a 2a 53 54 45 52 45  |Lib-Soft":*STERE|
00000160  4f 20 31 20 30 0d 00 78  29 20 c8 a1 20 32 2c 22  |O 1 0..x) .. 2,"|
00000170  53 74 72 69 6e 67 4c 69  62 2d 53 6f 66 74 22 3a  |StringLib-Soft":|
00000180  2a 53 54 45 52 45 4f 20  32 20 2d 31 32 37 0d 00  |*STEREO 2 -127..|
00000190  82 28 20 c8 a1 20 33 2c  22 53 74 72 69 6e 67 4c  |.( .. 3,"StringL|
000001a0  69 62 2d 53 6f 66 74 22  3a 2a 53 54 45 52 45 4f  |ib-Soft":*STEREO|
000001b0  20 33 20 31 32 37 0d 00  8c 3a 20 63 75 72 72 65  | 3 127...: curre|
000001c0  6e 74 3d 30 3a de 62 61  6c 6c 28 34 2c 31 29 3a  |nt=0:.ball(4,1):|
000001d0  62 62 78 3d 36 34 30 3a  62 62 79 3d 39 35 30 3a  |bbx=640:bby=950:|
000001e0  64 69 72 3d 32 37 30 3a  f2 73 65 74 75 70 62 62  |dir=270:.setupbb|
000001f0  0d 00 96 17 20 eb 31 35  3a c8 97 20 ee 3a f2 64  |.... .15:.. .:.d|
00000200  72 61 77 66 75 6c 6c 0d  00 a0 06 20 3a 0d 00 aa  |rawfull.... :...|
00000210  16 20 f4 20 53 74 61 72  74 20 6d 61 69 6e 20 6c  |. . Start main l|
00000220  6f 6f 70 0d 00 b4 0a 20  f5 3a 54 3d 91 0d 00 be  |oop.... .:T=....|
00000230  0a 20 f2 75 73 65 72 0d  00 c8 11 20 e7 20 69 64  |. .user.... . id|
00000240  6c 65 20 8c 20 fd 20 a3  0d 00 d2 0b 20 f2 73 65  |le . . ..... .se|
00000250  6e 73 65 0d 00 dc 1f 20  6d 6f 76 3d a4 61 69 28  |nse.... mov=.ai(|
00000260  66 72 65 71 61 2c 66 72  65 71 62 2c 66 72 65 71  |freqa,freqb,freq|
00000270  63 29 0d 00 e6 15 20 66  77 64 3d 28 6d 6f 76 20  |c).... fwd=(mov |
00000280  80 20 31 29 3c 3e 30 0d  00 f0 19 20 72 65 76 65  |. 1)<>0.... reve|
00000290  72 73 65 3d 28 6d 6f 76  20 80 20 32 29 3c 3e 30  |rse=(mov . 2)<>0|
000002a0  0d 00 fa 16 20 6c 65 66  74 3d 28 6d 6f 76 20 80  |.... left=(mov .|
000002b0  20 34 29 3c 3e 30 0d 01  04 17 20 72 69 67 68 74  | 4)<>0.... right|
000002c0  3d 28 6d 6f 76 20 80 20  38 29 3c 3e 30 0d 01 0e  |=(mov . 8)<>0...|
000002d0  18 20 74 75 72 62 6f 3d  28 6d 6f 76 20 80 20 31  |. turbo=(mov . 1|
000002e0  36 29 3c 3e 30 0d 01 18  0c 20 f2 6d 6f 76 65 69  |6)<>0.... .movei|
000002f0  74 0d 01 22 11 20 f5 20  fd 20 91 3e 28 54 2b 31  |t..". . . .>(T+1|
00000300  35 29 0d 01 2c 08 20 fd  20 a3 0d 01 36 06 20 3a  |5)..,. . ...6. :|
00000310  0d 01 40 18 20 f4 20 47  72 61 70 68 69 63 20 69  |..@. . Graphic i|
00000320  6e 74 65 72 66 61 63 65  0d 01 4a 0f 20 dd f2 64  |nterface..J. ..d|
00000330  72 61 77 66 75 6c 6c 0d  01 54 17 20 f4 20 53 65  |rawfull..T. . Se|
00000340  74 20 75 70 20 63 6f 6e  73 74 61 6e 74 73 0d 01  |t up constants..|
00000350  5e 11 20 ea 73 78 2c 73  79 2c 77 69 64 74 68 0d  |^. .sx,sy,width.|
00000360  01 68 17 20 73 78 3d 31  3a 73 79 3d 32 3a 77 69  |.h. sx=1:sy=2:wi|
00000370  64 74 68 3d 31 30 0d 01  72 1c 20 f4 20 44 72 61  |dth=10..r. . Dra|
00000380  77 20 67 72 65 65 6e 20  63 6f 75 72 74 20 61 72  |w green court ar|
00000390  65 61 0d 01 7c 25 20 db  3a e6 30 2c 25 30 30 31  |ea..|% .:.0,%001|
000003a0  31 30 30 3a c8 93 20 c8  90 20 30 2c 30 2c 31 32  |100:.. .. 0,0,12|
000003b0  37 39 2c 31 30 32 33 0d  01 86 26 20 f4 20 4d 61  |79,1023...& . Ma|
000003c0  72 6b 20 6f 75 74 20 77  68 69 74 65 20 6c 69 6e  |rk out white lin|
000003d0  65 73 20 6f 6e 74 6f 20  63 6f 75 72 74 0d 01 90  |es onto court...|
000003e0  b2 20 e6 30 2c 25 31 31  31 31 31 31 3a c8 93 20  |. .0,%111111:.. |
000003f0  c8 90 20 73 78 2f 28 32  33 2e 37 37 2b 32 2a 73  |.. sx/(23.77+2*s|
00000400  78 29 2a 31 32 38 30 2c  73 79 2f 28 31 30 2e 39  |x)*1280,sy/(10.9|
00000410  37 2b 32 2a 73 79 29 2a  31 30 32 34 2c 32 33 2e  |7+2*sy)*1024,23.|
00000420  37 37 2f 28 32 33 2e 37  37 2b 32 2a 73 78 29 2a  |77/(23.77+2*sx)*|
00000430  31 32 38 30 2c 77 69 64  74 68 3a c8 93 20 c8 90  |1280,width:.. ..|
00000440  20 73 78 2f 28 32 33 2e  37 37 2b 32 2a 73 78 29  | sx/(23.77+2*sx)|
00000450  2a 31 32 38 30 2c 28 31  2e 33 37 2b 73 79 29 2f  |*1280,(1.37+sy)/|
00000460  28 31 30 2e 39 37 2b 32  2a 73 79 29 2a 31 30 32  |(10.97+2*sy)*102|
00000470  34 2c 32 33 2e 37 37 2f  28 32 33 2e 37 37 2b 32  |4,23.77/(23.77+2|
00000480  2a 73 78 29 2a 31 32 38  30 2c 77 69 64 74 68 0d  |*sx)*1280,width.|
00000490  01 9a ae 20 c8 93 20 c8  90 20 73 78 2f 28 32 33  |... .. .. sx/(23|
000004a0  2e 37 37 2b 32 2a 73 78  29 2a 31 32 38 30 2c 28  |.77+2*sx)*1280,(|
000004b0  39 2e 36 2b 73 79 29 2f  28 31 30 2e 39 37 2b 32  |9.6+sy)/(10.97+2|
000004c0  2a 73 79 29 2a 31 30 32  34 2c 32 33 2e 37 37 2f  |*sy)*1024,23.77/|
000004d0  28 32 33 2e 37 37 2b 32  2a 73 78 29 2a 31 32 38  |(23.77+2*sx)*128|
000004e0  30 2c 77 69 64 74 68 3a  c8 93 20 c8 90 20 73 78  |0,width:.. .. sx|
000004f0  2f 28 32 33 2e 37 37 2b  32 2a 73 78 29 2a 31 32  |/(23.77+2*sx)*12|
00000500  38 30 2c 28 31 30 2e 39  37 2b 73 79 29 2f 28 31  |80,(10.97+sy)/(1|
00000510  30 2e 39 37 2b 32 2a 73  79 29 2a 31 30 32 34 2c  |0.97+2*sy)*1024,|
00000520  32 33 2e 37 37 2f 28 32  33 2e 37 37 2b 32 2a 73  |23.77/(23.77+2*s|
00000530  78 29 2a 31 32 38 30 2c  77 69 64 74 68 0d 01 a4  |x)*1280,width...|
00000540  5f 20 c8 93 20 c8 90 20  28 73 78 2b 35 2e 34 37  |_ .. .. (sx+5.47|
00000550  29 2f 28 32 33 2e 37 37  2b 32 2a 73 78 29 2a 31  |)/(23.77+2*sx)*1|
00000560  32 38 30 2c 28 73 79 2b  35 2e 34 39 29 2f 28 31  |280,(sy+5.49)/(1|
00000570  30 2e 39 37 2b 32 2a 73  79 29 2a 31 30 32 34 2c  |0.97+2*sy)*1024,|
00000580  31 32 2e 38 2f 28 32 33  2e 37 37 2b 32 2a 73 78  |12.8/(23.77+2*sx|
00000590  29 2a 31 32 38 30 2c 77  69 64 74 68 0d 01 ae ae  |)*1280,width....|
000005a0  20 c8 93 20 c8 90 20 73  78 2f 28 32 33 2e 37 37  | .. .. sx/(23.77|
000005b0  2b 32 2a 73 78 29 2a 31  32 38 30 2c 73 79 2f 28  |+2*sx)*1280,sy/(|
000005c0  31 30 2e 39 37 2b 32 2a  73 79 29 2a 31 30 32 34  |10.97+2*sy)*1024|
000005d0  2c 77 69 64 74 68 2c 31  30 2e 39 37 2f 28 31 30  |,width,10.97/(10|
000005e0  2e 39 37 2b 32 2a 73 79  29 2a 31 30 32 34 3a c8  |.97+2*sy)*1024:.|
000005f0  93 20 c8 90 20 28 73 78  2b 32 33 2e 37 37 29 2f  |. .. (sx+23.77)/|
00000600  28 32 33 2e 37 37 2b 32  2a 73 78 29 2a 31 32 38  |(23.77+2*sx)*128|
00000610  30 2c 73 79 2f 28 31 30  2e 39 37 2b 32 2a 73 79  |0,sy/(10.97+2*sy|
00000620  29 2a 31 30 32 34 2c 77  69 64 74 68 2c 31 30 2e  |)*1024,width,10.|
00000630  39 37 2f 28 31 30 2e 39  37 2b 32 2a 73 79 29 2a  |97/(10.97+2*sy)*|
00000640  31 30 32 34 2b 77 69 64  74 68 0d 01 b8 ba 20 c8  |1024+width.... .|
00000650  93 20 c8 90 20 28 73 78  2b 35 2e 34 37 29 2f 28  |. .. (sx+5.47)/(|
00000660  32 33 2e 37 37 2b 32 2a  73 78 29 2a 31 32 38 30  |23.77+2*sx)*1280|
00000670  2c 28 73 79 2b 31 2e 33  37 29 2f 28 31 30 2e 39  |,(sy+1.37)/(10.9|
00000680  37 2b 32 2a 73 79 29 2a  31 30 32 34 2c 77 69 64  |7+2*sy)*1024,wid|
00000690  74 68 2c 38 2e 32 33 2f  28 31 30 2e 39 37 2b 32  |th,8.23/(10.97+2|
000006a0  2a 73 79 29 2a 31 30 32  34 3a c8 93 20 c8 90 20  |*sy)*1024:.. .. |
000006b0  28 73 78 2b 31 38 2e 33  29 2f 28 32 33 2e 37 37  |(sx+18.3)/(23.77|
000006c0  2b 32 2a 73 78 29 2a 31  32 38 30 2c 28 73 79 2b  |+2*sx)*1280,(sy+|
000006d0  31 2e 33 37 29 2f 28 31  30 2e 39 37 2b 32 2a 73  |1.37)/(10.97+2*s|
000006e0  79 29 2a 31 30 32 34 2c  77 69 64 74 68 2c 38 2e  |y)*1024,width,8.|
000006f0  32 33 2f 28 31 30 2e 39  37 2b 32 2a 73 79 29 2a  |23/(10.97+2*sy)*|
00000700  31 30 32 34 0d 01 c2 06  20 3a 0d 01 cc 0f 20 f4  |1024.... :.... .|
00000710  20 44 72 61 77 20 6e 65  74 0d 01 d6 89 20 e6 30  | Draw net.... .0|
00000720  2c 30 3a e3 6c 3d 31 30  30 b8 39 32 34 88 31 30  |,0:.l=100.924.10|
00000730  3a ec 20 36 34 30 2c 6c  3a df 20 36 38 30 2c 6c  |:. 640,l:. 680,l|
00000740  2b 35 30 3a ed 3a e3 6c  3d 30 b8 34 30 88 31 30  |+50:.:.l=0.40.10|
00000750  3a ec 20 36 34 30 2b 6c  2c 31 30 30 2b 6c 3a df  |:. 640+l,100+l:.|
00000760  36 34 30 2b 6c 2c 39 32  34 2b 6c 3a ed 3a e3 6c  |640+l,924+l:.:.l|
00000770  3d 30 b8 35 3a ec 36 33  37 2b 6c 2c 31 30 30 3a  |=0.5:.637+l,100:|
00000780  df 36 37 37 2b 6c 2c 31  35 30 3a ec 36 33 37 2b  |.677+l,150:.637+|
00000790  6c 2c 39 32 34 3a df 36  37 37 2b 6c 2c 39 37 34  |l,924:.677+l,974|
000007a0  3a ed 0d 01 e0 22 20 e6  30 2c 25 31 31 31 31 31  |:...." .0,%11111|
000007b0  31 3a ec 20 36 38 32 2c  31 34 32 3a df 36 38 32  |1:. 682,142:.682|
000007c0  2c 39 36 36 0d 01 ea 0e  20 f2 64 72 61 77 6d 69  |,966.... .drawmi|
000007d0  6e 69 0d 01 f4 06 20 e1  0d 01 fe 06 20 3a 0d 02  |ni.... ..... :..|
000007e0  08 1d 20 f4 20 44 72 61  77 20 62 61 6c 6c 62 6f  |.. . Draw ballbo|
000007f0  74 20 61 6e 64 20 62 61  6c 6c 73 0d 02 12 0f 20  |t and balls.... |
00000800  dd f2 64 72 61 77 6d 69  6e 69 0d 02 1c 10 20 e6  |..drawmini.... .|
00000810  33 2c 31 3a e3 62 3d 30  b8 34 0d 02 26 42 20 e7  |3,1:.b=0.4..&B .|
00000820  20 62 61 6c 6c 28 62 2c  30 29 3c 3e 30 20 84 20  | ball(b,0)<>0 . |
00000830  62 61 6c 6c 28 62 2c 31  29 3c 3e 30 20 8c 20 c8  |ball(b,1)<>0 . .|
00000840  93 20 c8 90 20 62 61 6c  6c 28 62 2c 30 29 2c 62  |. .. ball(b,0),b|
00000850  61 6c 6c 28 62 2c 31 29  2c 35 2c 35 0d 02 30 06  |all(b,1),5,5..0.|
00000860  20 ed 0d 02 3a 21 20 e6  33 2c 25 31 31 30 30 30  | ...:! .3,%11000|
00000870  30 3a c8 93 20 c8 90 20  62 62 78 2c 62 62 79 2c  |0:.. .. bbx,bby,|
00000880  35 2c 35 0d 02 44 06 20  e1 0d 02 4e 06 20 3a 0d  |5,5..D. ...N. :.|
00000890  02 58 2a 20 f4 20 55 73  65 72 20 69 6e 74 65 72  |.X* . User inter|
000008a0  66 61 63 65 20 28 70 75  74 74 69 6e 67 20 62 61  |face (putting ba|
000008b0  6c 6c 73 20 64 6f 77 6e  29 0d 02 62 0b 20 dd f2  |lls down)..b. ..|
000008c0  75 73 65 72 0d 02 6c 0d  20 c8 97 20 78 2c 79 2c  |user..l. .. x,y,|
000008d0  63 0d 02 76 0e 20 e7 20  63 3d 30 20 8c 20 e1 0d  |c..v. . c=0 . ..|
000008e0  02 80 61 20 e7 20 28 63  20 80 20 34 29 3c 3e 30  |..a . (c . 4)<>0|
000008f0  20 8c 20 f2 64 72 61 77  6d 69 6e 69 3a 62 61 6c  | . .drawmini:bal|
00000900  6c 28 63 75 72 72 65 6e  74 2c 30 29 3d 78 3a 62  |l(current,0)=x:b|
00000910  61 6c 6c 28 63 75 72 72  65 6e 74 2c 31 29 3d 79  |all(current,1)=y|
00000920  3a 63 75 72 72 65 6e 74  3d 28 63 75 72 72 65 6e  |:current=(curren|
00000930  74 2b 31 29 83 35 3a f2  64 72 61 77 6d 69 6e 69  |t+1).5:.drawmini|
00000940  0d 02 8a 2a 20 e7 20 28  63 20 80 20 32 29 3c 3e  |...* . (c . 2)<>|
00000950  30 20 8c 20 69 64 6c 65  3d a3 3a 73 74 61 67 65  |0 . idle=.:stage|
00000960  3d 30 3a 73 74 61 72 74  3d 91 0d 02 94 06 20 f5  |=0:start=..... .|
00000970  0d 02 9e 0d 20 c8 97 20  78 2c 79 2c 63 0d 02 a8  |.... .. x,y,c...|
00000980  0a 20 fd 20 63 3d 30 0d  02 b2 06 20 e1 0d 02 bc  |. . c=0.... ....|
00000990  06 20 3a 0d 02 c6 27 20  f4 20 43 61 6c 63 75 6c  |. :...' . Calcul|
000009a0  61 74 65 20 62 61 6c 6c  62 6f 74 27 73 20 6e 65  |ate ballbot's ne|
000009b0  77 20 70 6f 73 69 74 69  6f 6e 0d 02 d0 0d 20 dd  |w position.... .|
000009c0  f2 6d 6f 76 65 69 74 0d  02 da 41 20 e7 20 28 6c  |.moveit...A . (l|
000009d0  65 66 74 20 80 20 66 77  64 29 20 84 20 28 72 69  |eft . fwd) . (ri|
000009e0  67 68 74 20 80 20 72 65  76 65 72 73 65 29 20 8c  |ght . reverse) .|
000009f0  20 64 69 72 3d 64 69 72  2d 32 2e 35 2a 28 31 2b  | dir=dir-2.5*(1+|
00000a00  33 2a 74 75 72 62 6f 29  0d 02 e4 41 20 e7 20 28  |3*turbo)...A . (|
00000a10  72 69 67 68 74 20 80 20  66 77 64 29 20 84 20 28  |right . fwd) . (|
00000a20  6c 65 66 74 20 80 20 72  65 76 65 72 73 65 29 20  |left . reverse) |
00000a30  8c 20 64 69 72 3d 64 69  72 2b 32 2e 35 2a 28 31  |. dir=dir+2.5*(1|
00000a40  2b 33 2a 74 75 72 62 6f  29 0d 02 ee 06 20 3a 0d  |+3*turbo).... :.|
00000a50  02 f8 29 20 f4 20 47 65  74 20 64 69 72 65 63 74  |..) . Get direct|
00000a60  69 6f 6e 20 69 6e 20 72  61 6e 67 65 20 30 3c 74  |ion in range 0<t|
00000a70  68 65 74 61 3c 33 36 30  0d 03 02 1c 20 f5 20 e7  |heta<360.... . .|
00000a80  20 64 69 72 3c 30 20 8c  20 64 69 72 3d 64 69 72  | dir<0 . dir=dir|
00000a90  2b 33 36 30 0d 03 0c 1d  20 e7 20 64 69 72 3e 3d  |+360.... . dir>=|
00000aa0  33 36 30 20 8c 20 64 69  72 3d 64 69 72 2d 33 36  |360 . dir=dir-36|
00000ab0  30 0d 03 16 17 20 fd 20  64 69 72 3e 3d 30 20 80  |0.... . dir>=0 .|
00000ac0  20 64 69 72 3c 33 36 30  0d 03 20 06 20 3a 0d 03  | dir<360.. . :..|
00000ad0  2a 1c 20 66 72 3d 30 3a  e7 20 66 77 64 20 8c 20  |*. fr=0:. fwd . |
00000ae0  66 72 3d 66 72 2b 30 2e  32 35 0d 03 34 1b 20 e7  |fr=fr+0.25..4. .|
00000af0  20 72 65 76 65 72 73 65  20 8c 20 66 72 3d 66 72  | reverse . fr=fr|
00000b00  2d 30 2e 32 35 0d 03 3e  16 20 e7 20 74 75 72 62  |-0.25..>. . turb|
00000b10  6f 20 8c 20 66 72 3d 66  72 2a 34 0d 03 48 29 20  |o . fr=fr*4..H) |
00000b20  f2 64 72 61 77 6d 69 6e  69 3a 62 62 78 3d 62 62  |.drawmini:bbx=bb|
00000b30  78 2b 31 36 2a b5 28 af  2a 64 69 72 2f 31 38 30  |x+16*.(.*dir/180|
00000b40  29 2a 66 72 0d 03 52 1f  20 62 62 79 3d 62 62 79  |)*fr..R. bby=bby|
00000b50  2b 31 36 2a 9b 28 af 2a  64 69 72 2f 31 38 30 29  |+16*.(.*dir/180)|
00000b60  2a 66 72 0d 03 5c 51 20  e3 62 61 6c 6c 3d 30 b8  |*fr..\Q .ball=0.|
00000b70  34 3a e7 20 94 28 62 62  78 2d 62 61 6c 6c 28 62  |4:. .(bbx-ball(b|
00000b80  61 6c 6c 2c 30 29 29 3c  31 30 20 80 20 94 28 62  |all,0))<10 . .(b|
00000b90  62 79 2d 62 61 6c 6c 28  62 61 6c 6c 2c 31 29 29  |by-ball(ball,1))|
00000ba0  3c 31 30 20 8c 20 62 61  6c 6c 28 62 61 6c 6c 2c  |<10 . ball(ball,|
00000bb0  30 29 3d 30 0d 03 66 10  20 ed 3a f2 64 72 61 77  |0)=0..f. .:.draw|
00000bc0  6d 69 6e 69 0d 03 70 06  20 e1 0d 03 7a 06 20 3a  |mini..p. ...z. :|
00000bd0  0d 03 84 3b 20 f4 20 43  61 6c 63 75 6c 61 74 65  |...; . Calculate|
00000be0  20 62 61 6c 6c 62 6f 74  27 73 20 62 61 63 6b 67  | ballbot's backg|
00000bf0  72 6f 75 6e 64 20 65 63  68 6f 20 72 65 61 64 69  |round echo readi|
00000c00  6e 67 20 28 2d 62 61 6c  6c 73 29 0d 03 8e 15 20  |ng (-balls).... |
00000c10  dd a4 62 61 63 6b 28 78  2c 79 2c 66 72 65 71 29  |..back(x,y,freq)|
00000c20  0d 03 98 30 20 f4 20 43  61 6c 63 75 6c 61 74 65  |...0 . Calculate|
00000c30  20 41 6e 67 6c 65 20 6f  66 20 6e 65 74 20 61 73  | Angle of net as|
00000c40  20 73 65 65 6e 20 62 79  20 42 61 6c 6c 62 6f 74  | seen by Ballbot|
00000c50  0d 03 a2 0c 20 ea 20 66  72 65 71 61 0d 03 ac 2b  |.... . freqa...+|
00000c60  20 6e 65 74 6c 6f 77 3d  28 a4 61 6e 67 6c 65 28  | netlow=(.angle(|
00000c70  36 34 30 2c 39 32 33 2c  78 2c 79 29 2d 64 69 72  |640,923,x,y)-dir|
00000c80  29 20 83 20 33 36 30 0d  03 b6 23 20 e7 20 6e 65  |) . 360...# . ne|
00000c90  74 6c 6f 77 3c 30 20 8c  20 6e 65 74 6c 6f 77 3d  |tlow<0 . netlow=|
00000ca0  6e 65 74 6c 6f 77 2b 33  36 30 0d 03 c0 25 20 e7  |netlow+360...% .|
00000cb0  20 6e 65 74 6c 6f 77 3e  31 38 30 20 8c 20 6e 65  | netlow>180 . ne|
00000cc0  74 6c 6f 77 3d 6e 65 74  6c 6f 77 2d 33 36 30 0d  |tlow=netlow-360.|
00000cd0  03 ca 2a 20 6e 65 74 68  69 3d 28 a4 61 6e 67 6c  |..* nethi=(.angl|
00000ce0  65 28 36 34 30 2c 31 30  30 2c 78 2c 79 29 2d 64  |e(640,100,x,y)-d|
00000cf0  69 72 29 20 83 20 33 36  30 0d 03 d4 20 20 e7 20  |ir) . 360...  . |
00000d00  6e 65 74 68 69 3c 30 20  8c 20 6e 65 74 68 69 3d  |nethi<0 . nethi=|
00000d10  6e 65 74 68 69 2b 33 36  30 0d 03 de 22 20 e7 20  |nethi+360..." . |
00000d20  6e 65 74 68 69 3e 31 38  30 20 8c 20 6e 65 74 68  |nethi>180 . neth|
00000d30  69 3d 6e 65 74 68 69 2d  33 36 30 0d 03 e8 06 20  |i=nethi-360.... |
00000d40  3a 0d 03 f2 18 20 f4 20  43 61 6c 63 75 6c 61 74  |:.... . Calculat|
00000d50  65 20 72 65 61 64 69 6e  67 0d 03 fc 16 20 66 72  |e reading.... fr|
00000d60  65 71 61 3d 66 72 65 71  2b b3 28 36 29 2d 33 0d  |eqa=freq+.(6)-3.|
00000d70  04 06 83 20 e7 20 94 28  b5 28 af 2a 64 69 72 2f  |... . .(.(.*dir/|
00000d80  31 38 30 29 29 3e 30 2e  30 31 20 8c 20 e7 20 28  |180))>0.01 . . (|
00000d90  28 6e 65 74 6c 6f 77 3c  30 20 80 20 6e 65 74 68  |(netlow<0 . neth|
00000da0  69 3e 30 29 20 84 20 28  6e 65 74 68 69 3c 30 20  |i>0) . (nethi<0 |
00000db0  80 20 6e 65 74 6c 6f 77  3e 30 29 29 20 80 20 28  |. netlow>0)) . (|
00000dc0  36 34 30 2d 78 29 2f b5  28 af 2a 64 69 72 2f 31  |640-x)/.(.*dir/1|
00000dd0  38 30 29 3e 30 20 8c 20  66 72 65 71 61 3d 28 36  |80)>0 . freqa=(6|
00000de0  34 30 2d 78 29 2f b5 28  af 2a 64 69 72 2f 31 38  |40-x)/.(.*dir/18|
00000df0  30 29 0d 04 10 0b 20 3d  66 72 65 71 61 0d 04 1a  |0).... =freqa...|
00000e00  06 20 3a 0d 04 24 32 20  f4 20 43 61 6c 63 75 6c  |. :..$2 . Calcul|
00000e10  61 74 65 20 42 61 6c 6c  62 6f 74 27 73 20 72 65  |ate Ballbot's re|
00000e20  61 64 69 6e 67 73 20 28  4d 41 49 4e 20 52 4f 55  |adings (MAIN ROU|
00000e30  54 49 4e 45 29 0d 04 2e  06 20 3a 0d 04 38 0c 20  |TINE).... :..8. |
00000e40  dd f2 73 65 6e 73 65 0d  04 42 2a 20 f4 20 47 65  |..sense..B* . Ge|
00000e50  74 20 62 61 63 6b 67 72  6f 75 6e 64 20 72 65 61  |t background rea|
00000e60  64 69 6e 67 73 20 66 72  6f 6d 20 46 4e 62 61 63  |dings from FNbac|
00000e70  6b 0d 04 4c 35 20 66 72  65 71 3d b3 28 32 35 30  |k..L5 freq=.(250|
00000e80  29 2b 31 35 30 30 3a 66  61 24 3d 22 55 22 3a 66  |)+1500:fa$="U":f|
00000e90  62 24 3d 66 61 24 3a 66  63 24 3d 66 61 24 3a 66  |b$=fa$:fc$=fa$:f|
00000ea0  64 24 3d 66 61 24 0d 04  56 1e 20 66 72 65 71 61  |d$=fa$..V. freqa|
00000eb0  3d a4 62 61 63 6b 28 62  62 78 2c 62 62 79 2c 66  |=.back(bbx,bby,f|
00000ec0  72 65 71 29 0d 04 60 29  20 64 69 72 3d 64 69 72  |req)..`) dir=dir|
00000ed0  2d 33 30 3a 66 72 65 71  62 3d a4 62 61 63 6b 28  |-30:freqb=.back(|
00000ee0  62 62 78 2c 62 62 79 2c  66 72 65 71 29 0d 04 6a  |bbx,bby,freq)..j|
00000ef0  29 20 64 69 72 3d 64 69  72 2b 36 30 3a 66 72 65  |) dir=dir+60:fre|
00000f00  71 63 3d a4 62 61 63 6b  28 62 62 78 2c 62 62 79  |qc=.back(bbx,bby|
00000f10  2c 66 72 65 71 29 0d 04  74 35 20 64 69 72 3d 64  |,freq)..t5 dir=d|
00000f20  69 72 2d 31 30 35 3a 66  72 65 71 64 3d a4 62 61  |ir-105:freqd=.ba|
00000f30  63 6b 28 62 62 78 2c 62  62 79 2c 66 72 65 71 29  |ck(bbx,bby,freq)|
00000f40  3a 64 69 72 3d 64 69 72  2b 37 35 0d 04 7e 06 20  |:dir=dir+75..~. |
00000f50  3a 0d 04 88 44 20 f4 20  41 64 64 20 61 6e 79 20  |:...D . Add any |
00000f60  72 65 6c 65 76 61 6e 74  20 62 61 6c 6c 73 20 74  |relevant balls t|
00000f70  6f 20 72 65 61 64 69 6e  67 73 20 28 75 73 69 6e  |o readings (usin|
00000f80  67 20 68 61 69 72 79 20  74 72 69 67 6f 6e 6f 6d  |g hairy trigonom|
00000f90  65 74 72 79 29 0d 04 92  06 20 3a 0d 04 9c 0e 20  |etry).... :.... |
00000fa0  e3 62 61 6c 6c 3d 30 b8  34 0d 04 a6 34 20 64 25  |.ball=0.4...4 d%|
00000fb0  3d b6 28 28 62 61 6c 6c  28 62 61 6c 6c 2c 30 29  |=.((ball(ball,0)|
00000fc0  2d 62 62 78 29 5e 32 2b  28 62 61 6c 6c 28 62 61  |-bbx)^2+(ball(ba|
00000fd0  6c 6c 2c 31 29 2d 62 62  79 29 5e 32 29 0d 04 b0  |ll,1)-bby)^2)...|
00000fe0  1f 20 e7 20 62 61 6c 6c  28 62 61 6c 6c 2c 30 29  |. . ball(ball,0)|
00000ff0  3d 30 20 8c 20 64 25 3d  39 39 39 39 0d 04 ba 34  |=0 . d%=9999...4|
00001000  20 61 3d a4 61 6e 67 6c  65 28 62 61 6c 6c 28 62  | a=.angle(ball(b|
00001010  61 6c 6c 2c 30 29 2c 62  61 6c 6c 28 62 61 6c 6c  |all,0),ball(ball|
00001020  2c 31 29 2c 62 62 78 2c  62 62 79 29 2d 64 69 72  |,1),bbx,bby)-dir|
00001030  0d 04 c4 2c 20 e7 20 94  28 61 29 3c 31 35 20 80  |..., . .(a)<15 .|
00001040  20 66 72 65 71 61 3e 64  25 20 8c 20 66 72 65 71  | freqa>d% . freq|
00001050  61 3d 64 25 3a 66 61 24  3d 22 42 22 0d 04 ce 33  |a=d%:fa$="B"...3|
00001060  20 e7 20 61 3e 2d 34 36  20 80 20 61 3c 3d 2d 31  | . a>-46 . a<=-1|
00001070  35 20 80 20 66 72 65 71  62 3e 64 25 20 8c 20 66  |5 . freqb>d% . f|
00001080  72 65 71 62 3d 64 25 3a  66 62 24 3d 22 42 22 0d  |reqb=d%:fb$="B".|
00001090  04 d8 31 20 e7 20 61 3e  3d 31 35 20 80 20 61 3c  |..1 . a>=15 . a<|
000010a0  34 36 20 80 20 66 72 65  71 63 3e 64 25 20 8c 20  |46 . freqc>d% . |
000010b0  66 72 65 71 63 3d 64 25  3a 66 63 24 3d 22 42 22  |freqc=d%:fc$="B"|
000010c0  0d 04 e2 33 20 e7 20 61  3e 2d 39 30 20 80 20 61  |...3 . a>-90 . a|
000010d0  3c 3d 2d 34 36 20 80 20  66 72 65 71 64 3e 64 25  |<=-46 . freqd>d%|
000010e0  20 8c 20 66 72 65 71 64  3d 64 25 3a 66 64 24 3d  | . freqd=d%:fd$=|
000010f0  22 42 22 0d 04 ec 06 20  ed 0d 04 f6 06 20 3a 0d  |"B".... ..... :.|
00001100  05 00 1b 20 f4 20 55 70  64 61 74 65 20 75 73 65  |... . Update use|
00001110  72 20 64 69 73 70 6c 61  79 73 0d 05 0a 06 20 3a  |r displays.... :|
00001120  0d 05 14 36 20 f1 8a 30  2c 30 29 a8 28 28 91 2d  |...6 ..0,0).((.-|
00001130  73 74 61 72 74 29 2f 36  30 30 30 29 3b 22 3a 22  |start)/6000);":"|
00001140  3b 28 a8 28 28 91 2d 73  74 61 72 74 29 2f 31 30  |;(.((.-start)/10|
00001150  30 29 83 36 30 29 0d 05  1e 4e 20 f1 8a 30 2c 33  |0).60)...N ..0,3|
00001160  31 29 a8 28 66 72 65 71  64 29 2c a8 28 66 72 65  |1).(freqd),.(fre|
00001170  71 62 29 2c a8 28 66 72  65 71 61 29 2c a8 28 66  |qb),.(freqa),.(f|
00001180  72 65 71 63 29 2c 73 74  61 67 65 2c a8 28 73 65  |reqc),stage,.(se|
00001190  61 72 63 68 69 6e 67 29  2c 6c 65 66 74 2c 72 69  |arching),left,ri|
000011a0  67 68 74 3b 0d 05 28 37  20 d4 20 31 2c 2d 31 2c  |ght;..(7 . 1,-1,|
000011b0  66 72 65 71 61 2f 34 2c  35 3a d4 20 32 2c 2d 31  |freqa/4,5:. 2,-1|
000011c0  2c 66 72 65 71 62 2f 34  2c 35 3a d4 20 33 2c 2d  |,freqb/4,5:. 3,-|
000011d0  31 2c 66 72 65 71 63 2f  34 2c 35 0d 05 32 06 20  |1,freqc/4,5..2. |
000011e0  e1 0d 05 3c 05 3a 0d 05  46 24 20 f4 20 43 61 6c  |...<.:..F$ . Cal|
000011f0  63 75 6c 61 74 65 20 62  65 61 72 69 6e 67 20 6f  |culate bearing o|
00001200  66 20 42 20 66 72 6f 6d  20 41 0d 05 50 19 20 dd  |f B from A..P. .|
00001210  a4 61 6e 67 6c 65 28 78  31 2c 79 31 2c 78 32 2c  |.angle(x1,y1,x2,|
00001220  79 32 29 0d 05 5a 34 20  e7 20 79 32 3d 79 31 20  |y2)..Z4 . y2=y1 |
00001230  8c 20 61 6e 67 3d 39 30  20 8b 20 61 6e 67 3d 31  |. ang=90 . ang=1|
00001240  38 30 2a 99 28 28 78 32  2d 78 31 29 2f 28 79 32  |80*.((x2-x1)/(y2|
00001250  2d 79 31 29 29 2f af 0d  05 64 1c 20 e7 20 28 79  |-y1))/...d. . (y|
00001260  32 3e 79 31 29 20 8c 20  61 6e 67 3d 61 6e 67 2b  |2>y1) . ang=ang+|
00001270  31 38 30 0d 05 6e 1a 20  e7 20 61 6e 67 3c 30 20  |180..n. . ang<0 |
00001280  8c 20 61 6e 67 3d 61 6e  67 2b 33 36 30 0d 05 78  |. ang=ang+360..x|
00001290  0f 20 3d 61 6e 67 20 83  20 33 36 30 0d 05 82 06  |. =ang . 360....|
000012a0  20 3a 0d 05 8c 2a 20 f4  20 42 41 4c 4c 42 4f 54  | :...* . BALLBOT|
000012b0  20 52 4f 42 4f 54 49 43  20 49 4e 54 45 4c 4c 49  | ROBOTIC INTELLI|
000012c0  47 45 4e 43 45 20 4d 4f  44 55 4c 45 0d 05 96 06  |GENCE MODULE....|
000012d0  20 3a 0d 05 a0 1c 20 dd  a4 61 69 28 66 72 65 71  | :.... ..ai(freq|
000012e0  61 2c 66 72 65 71 62 2c  66 72 65 71 63 29 0d 05  |a,freqb,freqc)..|
000012f0  aa 39 20 f4 20 41 72 74  69 66 69 63 69 61 6c 20  |.9 . Artificial |
00001300  69 6e 74 65 6c 6c 69 67  65 6e 63 65 20 72 6f 75  |intelligence rou|
00001310  74 69 6e 65 73 20 28 69  65 2e 20 57 68 61 74 20  |tines (ie. What |
00001320  4e 65 78 74 3f 3f 29 0d  05 b4 22 20 ea 66 77 64  |Next??)..." .fwd|
00001330  2c 72 65 76 65 72 73 65  2c 6c 65 66 74 2c 72 69  |,reverse,left,ri|
00001340  67 68 74 2c 74 75 72 62  6f 0d 05 be 2b 20 66 77  |ght,turbo...+ fw|
00001350  64 3d b9 3a 72 65 76 65  72 73 65 3d a3 3a 6c 65  |d=.:reverse=.:le|
00001360  66 74 3d a3 3a 72 69 67  68 74 3d a3 3a 74 75 72  |ft=.:right=.:tur|
00001370  62 6f 3d a3 0d 05 c8 06  20 3a 0d 05 d2 40 20 f4  |bo=..... :...@ .|
00001380  20 57 68 61 74 20 73 74  61 67 65 20 61 72 65 20  | What stage are |
00001390  77 65 20 69 6e 3f 20 48  75 6e 74 20 66 6f 72 20  |we in? Hunt for |
000013a0  62 61 6c 6c 73 20 6f 72  20 6d 6f 76 65 20 74 6f  |balls or move to|
000013b0  20 6e 65 77 20 61 72 65  61 3f 0d 05 dc 27 20 e7  | new area?...' .|
000013c0  20 6e 65 61 72 3c 3e 30  20 80 20 73 74 61 67 65  | near<>0 . stage|
000013d0  3c 38 20 8c 20 f2 64 6f  6e 65 61 72 73 74 75 66  |<8 . .donearstuf|
000013e0  66 0d 05 e6 2b 20 e7 20  6e 65 61 72 3d 30 20 80  |f...+ . near=0 .|
000013f0  20 28 73 74 61 67 65 3d  30 20 84 20 73 74 61 67  | (stage=0 . stag|
00001400  65 3d 32 29 20 8c 20 f2  68 75 6e 74 0d 05 f0 2e  |e=2) . .hunt....|
00001410  20 e7 20 6e 65 61 72 3d  30 20 80 20 28 73 74 61  | . near=0 . (sta|
00001420  67 65 3d 31 20 84 20 73  74 61 67 65 3d 33 29 20  |ge=1 . stage=3) |
00001430  8c 20 f2 6d 6f 76 65 6f  75 74 0d 05 fa 1a 20 e7  |. .moveout.... .|
00001440  20 73 74 61 67 65 3d 34  20 8c 20 f2 72 65 6c 65  | stage=4 . .rele|
00001450  61 73 65 62 0d 06 04 06  20 3a 0d 06 0e 32 20 f4  |aseb.... :...2 .|
00001460  20 50 72 65 70 61 72 65  20 6f 75 74 70 75 74 20  | Prepare output |
00001470  69 6e 74 6f 20 62 69 6e  61 72 79 20 66 6f 72 20  |into binary for |
00001480  74 72 61 6e 73 6d 69 73  73 69 6f 6e 0d 06 18 1f  |transmission....|
00001490  20 66 65 65 64 3d 30 3a  e7 20 66 77 64 20 8c 20  | feed=0:. fwd . |
000014a0  66 65 65 64 3d 66 65 65  64 2b 31 0d 06 22 17 20  |feed=feed+1..". |
000014b0  e7 20 72 65 76 69 6e 67  20 8c 20 74 75 72 62 6f  |. reving . turbo|
000014c0  3d b9 0d 06 2c 1c 20 e7  20 72 65 76 65 72 73 65  |=...,. . reverse|
000014d0  20 8c 20 66 65 65 64 3d  66 65 65 64 2b 32 0d 06  | . feed=feed+2..|
000014e0  36 19 20 e7 20 6c 65 66  74 20 8c 20 66 65 65 64  |6. . left . feed|
000014f0  3d 66 65 65 64 2b 34 0d  06 40 1a 20 e7 20 72 69  |=feed+4..@. . ri|
00001500  67 68 74 20 8c 20 66 65  65 64 3d 66 65 65 64 2b  |ght . feed=feed+|
00001510  38 0d 06 4a 1b 20 e7 20  74 75 72 62 6f 20 8c 20  |8..J. . turbo . |
00001520  66 65 65 64 3d 66 65 65  64 2b 31 36 0d 06 54 0a  |feed=feed+16..T.|
00001530  20 3d 66 65 65 64 0d 06  5e 06 20 3a 0d 06 68 28  | =feed..^. :..h(|
00001540  20 f4 20 50 65 72 66 6f  72 6d 20 61 20 73 77 65  | . Perform a swe|
00001550  65 70 20 74 6f 20 66 69  6e 64 20 61 6e 79 20 62  |ep to find any b|
00001560  61 6c 6c 73 0d 06 72 0b  20 dd f2 68 75 6e 74 0d  |alls..r. ..hunt.|
00001570  06 7c 23 20 f4 20 57 61  74 63 68 20 6f 75 74 20  |.|# . Watch out |
00001580  69 66 20 74 6f 6f 20 6e  65 61 72 20 74 6f 20 6e  |if too near to n|
00001590  65 74 0d 06 86 be 20 e7  28 28 66 72 65 71 61 3c  |et.... .((freqa<|
000015a0  32 30 80 20 66 61 24 3c  3e 22 42 22 29 84 28 66  |20. fa$<>"B").(f|
000015b0  72 65 71 62 3c 32 30 80  20 66 62 24 3c 3e 22 42  |reqb<20. fb$<>"B|
000015c0  22 29 84 28 66 72 65 71  63 3c 32 30 80 20 66 63  |").(freqc<20. fc|
000015d0  24 3c 3e 22 42 22 29 29  84 28 72 65 76 69 6e 67  |$<>"B")).(reving|
000015e0  20 80 28 28 66 72 65 71  61 3c 31 35 30 80 20 66  | .((freqa<150. f|
000015f0  61 24 3c 3e 22 42 22 29  84 28 66 72 65 71 62 3c  |a$<>"B").(freqb<|
00001600  31 35 30 80 20 66 62 24  3c 3e 22 42 22 29 84 28  |150. fb$<>"B").(|
00001610  66 72 65 71 63 3c 31 35  30 80 20 66 63 24 3c 3e  |freqc<150. fc$<>|
00001620  22 42 22 29 29 29 8c 72  65 76 69 6e 67 3d b9 3a  |"B"))).reving=.:|
00001630  72 65 76 65 72 73 65 3d  b9 3a 66 77 64 3d a3 3a  |reverse=.:fwd=.:|
00001640  6c 65 66 74 3d a3 3a 72  69 67 68 74 3d a3 3a e1  |left=.:right=.:.|
00001650  0d 06 90 0d 20 72 65 76  69 6e 67 3d a3 0d 06 9a  |.... reving=....|
00001660  06 20 3a 0d 06 a4 3a 20  f4 20 49 66 20 42 61 6c  |. :...: . If Bal|
00001670  6c 20 69 73 20 6f 75 74  20 6f 66 20 72 65 61 63  |l is out of reac|
00001680  68 20 69 6e 20 74 68 65  20 22 44 22 20 73 65 63  |h in the "D" sec|
00001690  74 6f 72 2c 20 72 65 76  65 72 73 65 21 0d 06 ae  |tor, reverse!...|
000016a0  b2 20 46 44 52 3d 66 72  65 71 64 2a 31 2e 32 35  |. FDR=freqd*1.25|
000016b0  3a e7 20 66 64 24 3d 22  42 22 20 80 20 46 44 52  |:. fd$="B" . FDR|
000016c0  3c 66 72 65 71 61 20 80  20 46 44 52 3c 66 72 65  |<freqa . FDR<fre|
000016d0  71 62 20 80 20 46 44 52  3c 66 72 65 71 63 20 80  |qb . FDR<freqc .|
000016e0  20 28 66 61 24 3c 3e 22  42 22 20 84 20 66 72 65  | (fa$<>"B" . fre|
000016f0  71 61 3e 31 30 30 29 20  80 20 28 66 62 24 3c 3e  |qa>100) . (fb$<>|
00001700  22 42 22 20 84 20 66 72  65 71 62 3e 31 30 30 29  |"B" . freqb>100)|
00001710  20 80 20 28 66 63 24 3c  3e 22 42 22 20 84 20 66  | . (fc$<>"B" . f|
00001720  72 65 71 63 3e 31 30 30  29 20 8c 20 72 65 76 65  |reqc>100) . reve|
00001730  72 73 65 3d b9 3a 66 77  64 3d a3 3a 72 69 67 68  |rse=.:fwd=.:righ|
00001740  74 3d b9 3a 66 61 72 6c  65 66 74 3d 36 3a e1 0d  |t=.:farleft=6:..|
00001750  06 b8 3e 20 e7 20 66 61  72 6c 65 66 74 3e 30 20  |..> . farleft>0 |
00001760  8c 20 66 61 72 6c 65 66  74 3d 66 61 72 6c 65 66  |. farleft=farlef|
00001770  74 2d 31 3a 72 65 76 65  72 73 65 3d b9 3a 66 77  |t-1:reverse=.:fw|
00001780  64 3d a3 3a 72 69 67 68  74 3d b9 3a e1 0d 06 c2  |d=.:right=.:....|
00001790  06 20 3a 0d 06 cc 1a 20  f4 20 52 6f 74 61 74 65  |. :.... . Rotate|
000017a0  20 74 6f 20 66 61 63 65  20 62 61 6c 6c 0d 06 d6  | to face ball...|
000017b0  38 20 e7 20 66 61 24 3d  22 42 22 20 8c 20 73 65  |8 . fa$="B" . se|
000017c0  61 72 63 68 69 6e 67 3d  73 65 61 72 63 68 69 6e  |arching=searchin|
000017d0  67 2f 32 3a 74 75 72 62  6f 3d 66 72 65 71 61 3e  |g/2:turbo=freqa>|
000017e0  31 30 30 3a e1 0d 06 e0  19 20 e7 20 66 62 24 3d  |100:..... . fb$=|
000017f0  22 42 22 20 8c 20 6c 65  66 74 3d b9 3a e1 0d 06  |"B" . left=.:...|
00001800  ea 1a 20 e7 20 66 63 24  3d 22 42 22 20 8c 20 72  |.. . fc$="B" . r|
00001810  69 67 68 74 3d b9 3a e1  0d 06 f4 30 20 f4 20 49  |ight=.:....0 . I|
00001820  66 20 6e 6f 20 62 61 6c  6c 20 69 6e 20 73 69 67  |f no ball in sig|
00001830  68 74 2c 20 63 6f 6e 74  69 6e 75 65 20 72 6f 74  |ht, continue rot|
00001840  61 74 69 6f 6e 2e 2e 2e  0d 06 fe 43 20 61 6c 69  |ation......C ali|
00001850  67 6e 3d a3 3a 73 65 61  72 63 68 69 6e 67 3d 73  |gn=.:searching=s|
00001860  65 61 72 63 68 69 6e 67  2b 31 3a e7 20 73 65 61  |earching+1:. sea|
00001870  72 63 68 69 6e 67 3c 35  20 8c 20 72 69 67 68 74  |rching<5 . right|
00001880  3d b9 20 8b 20 6c 65 66  74 3d b9 0d 07 08 24 20  |=. . left=....$ |
00001890  e7 20 73 65 61 72 63 68  69 6e 67 3e 31 35 30 20  |. searching>150 |
000018a0  8c 20 73 74 61 67 65 3d  73 74 61 67 65 2b 31 0d  |. stage=stage+1.|
000018b0  07 12 06 20 e1 0d 07 1c  06 20 3a 0d 07 26 3c 20  |... ..... :..&< |
000018c0  f4 20 46 69 6e 64 20 65  64 67 65 20 6f 66 20 6e  |. Find edge of n|
000018d0  65 74 20 61 6e 64 20 61  69 6d 20 66 6f 72 20 69  |et and aim for i|
000018e0  74 20 74 6f 20 6d 6f 76  65 20 74 6f 20 6f 74 68  |t to move to oth|
000018f0  65 72 20 73 69 64 65 0d  07 30 0e 20 dd f2 6d 6f  |er side..0. ..mo|
00001900  76 65 6f 75 74 0d 07 3a  23 20 f4 20 57 61 74 63  |veout..:# . Watc|
00001910  68 20 6f 75 74 20 69 66  20 74 6f 6f 20 6e 65 61  |h out if too nea|
00001920  72 20 74 6f 20 6e 65 74  0d 07 44 84 20 e7 20 28  |r to net..D. . (|
00001930  66 72 65 71 61 3c 33 30  20 84 20 66 72 65 71 62  |freqa<30 . freqb|
00001940  3c 33 30 20 84 20 66 72  65 71 63 3c 33 30 29 20  |<30 . freqc<30) |
00001950  84 20 28 72 65 76 69 6e  67 20 80 20 28 66 72 65  |. (reving . (fre|
00001960  71 61 3c 31 32 35 20 84  20 66 72 65 71 62 3c 31  |qa<125 . freqb<1|
00001970  32 35 20 84 20 66 72 65  71 63 3c 31 32 35 29 29  |25 . freqc<125))|
00001980  20 8c 20 72 65 76 69 6e  67 3d b9 3a 72 65 76 65  | . reving=.:reve|
00001990  72 73 65 3d b9 3a 66 77  64 3d a3 3a 6c 65 66 74  |rse=.:fwd=.:left|
000019a0  3d a3 3a 72 69 67 68 74  3d a3 3a e1 0d 07 4e 0d  |=.:right=.:...N.|
000019b0  20 72 65 76 69 6e 67 3d  a3 0d 07 58 2c 20 f4 20  | reving=...X, . |
000019c0  41 6c 69 67 6e 20 62 61  6c 6c 62 6f 74 20 74 6f  |Align ballbot to|
000019d0  20 66 61 63 65 20 74 68  65 20 6e 65 74 20 70 6f  | face the net po|
000019e0  73 74 2e 2e 2e 0d 07 62  23 20 e7 20 66 72 65 71  |st.....b# . freq|
000019f0  64 3c 37 35 20 8c 20 72  69 67 68 74 3d b9 3a 74  |d<75 . right=.:t|
00001a00  75 72 62 6f 3d b9 3a e1  0d 07 6c 1c 20 e7 20 66  |urbo=.:...l. . f|
00001a10  72 65 71 61 3c 33 35 30  20 8c 20 72 69 67 68 74  |reqa<350 . right|
00001a20  3d b9 3a e1 0d 07 76 2e  20 e7 20 66 72 65 71 62  |=.:...v. . freqb|
00001a30  3c 36 30 20 80 20 66 72  65 71 61 3e 32 30 30 20  |<60 . freqa>200 |
00001a40  8c 20 72 69 67 68 74 3d  b9 3a 6e 65 61 72 3d 31  |. right=.:near=1|
00001a50  3a e1 0d 07 80 34 20 e7  20 66 72 65 71 61 3c 32  |:....4 . freqa<2|
00001a60  30 30 20 80 20 66 72 65  71 62 3c 32 30 30 20 80  |00 . freqb<200 .|
00001a70  20 66 72 65 71 63 3c 32  30 30 20 8c 20 72 69 67  | freqc<200 . rig|
00001a80  68 74 3d b9 3a e1 0d 07  8a 23 20 e7 20 28 66 72  |ht=.:....# . (fr|
00001a90  65 71 62 2a 31 2e 35 29  3e 66 72 65 71 63 20 8c  |eqb*1.5)>freqc .|
00001aa0  20 6c 65 66 74 3d b9 3a  e1 0d 07 94 1a 20 e7 20  | left=.:..... . |
00001ab0  66 72 65 71 62 3e 31 30  30 20 8c 20 74 75 72 62  |freqb>100 . turb|
00001ac0  6f 3d b9 0d 07 9e 06 20  e1 0d 07 a8 06 20 3a 0d  |o=..... ..... :.|
00001ad0  07 b2 47 20 f4 20 4e 65  61 72 6c 79 20 74 68 65  |..G . Nearly the|
00001ae0  72 65 2e 2e 2e 20 4a 75  73 74 20 6e 65 65 64 20  |re... Just need |
00001af0  61 20 6c 69 74 74 6c 65  20 6e 75 64 67 65 20 69  |a little nudge i|
00001b00  6e 20 74 68 65 20 72 69  67 68 74 20 64 69 72 65  |n the right dire|
00001b10  63 74 69 6f 6e 2e 0d 07  bc 12 20 dd f2 64 6f 6e  |ction..... ..don|
00001b20  65 61 72 73 74 75 66 66  0d 07 c6 10 20 6e 65 61  |earstuff.... nea|
00001b30  72 3d 6e 65 61 72 2b 31  0d 07 d0 19 20 e7 20 6e  |r=near+1.... . n|
00001b40  65 61 72 3c 38 20 8c 20  72 69 67 68 74 3d b9 3a  |ear<8 . right=.:|
00001b50  e1 0d 07 da 0b 20 6c 65  66 74 3d b9 0d 07 e4 31  |..... left=....1|
00001b60  20 e7 20 6e 65 61 72 3e  31 36 20 8c 20 6e 65 61  | . near>16 . nea|
00001b70  72 3d 30 3a 73 74 61 67  65 3d 73 74 61 67 65 2b  |r=0:stage=stage+|
00001b80  31 3a 73 65 61 72 63 68  69 6e 67 3d 30 0d 07 ee  |1:searching=0...|
00001b90  06 20 e1 0d 07 f8 06 20  3a 0d 08 02 3d 20 f4 20  |. ..... :...= . |
00001ba0  49 6e 69 74 69 61 6c 69  73 65 20 42 61 6c 6c 42  |Initialise BallB|
00001bb0  6f 74 20 76 61 72 69 61  62 6c 65 73 20 61 74 20  |ot variables at |
00001bc0  74 68 65 20 62 65 67 69  6e 6e 69 6e 67 20 6f 66  |the beginning of|
00001bd0  20 61 20 72 75 6e 0d 08  0c 0e 20 dd f2 73 65 74  | a run.... ..set|
00001be0  75 70 62 62 0d 08 16 3f  20 72 65 76 69 6e 67 3d  |upbb...? reving=|
00001bf0  a3 3a 6c 65 66 74 3d a3  3a 72 69 67 68 74 3d a3  |.:left=.:right=.|
00001c00  3a 66 77 64 3d a3 3a 72  65 76 65 72 73 65 3d a3  |:fwd=.:reverse=.|
00001c10  3a 73 65 61 72 63 68 69  6e 67 3d 30 3a 69 64 6c  |:searching=0:idl|
00001c20  65 3d b9 0d 08 20 15 20  6e 65 61 72 3d a3 3a 66  |e=... . near=.:f|
00001c30  61 72 6c 65 66 74 3d 30  0d 08 2a 06 20 e1 0d 08  |arleft=0..*. ...|
00001c40  34 06 20 3a 0d 08 3e 0f  20 dd f2 72 65 6c 65 61  |4. :..>. ..relea|
00001c50  73 65 62 0d 08 48 2d 20  f4 20 47 6f 74 20 61 6c  |seb..H- . Got al|
00001c60  6c 20 74 68 65 20 62 61  6c 6c 73 2c 20 6e 6f 77  |l the balls, now|
00001c70  20 6a 75 73 74 20 64 75  6d 70 20 74 68 65 6d 21  | just dump them!|
00001c80  0d 08 52 20 20 6e 65 61  72 3d 6e 65 61 72 2b 31  |..R  near=near+1|
00001c90  3a 72 65 76 65 72 73 65  3d b9 3a 66 77 64 3d a3  |:reverse=.:fwd=.|
00001ca0  0d 08 5c 1d 20 e7 20 6e  65 61 72 3e 39 20 8c 20  |..\. . near>9 . |
00001cb0  69 64 6c 65 3d b9 3a 6e  65 61 72 3d a3 0d 08 66  |idle=.:near=...f|
00001cc0  06 20 e1 0d 08 70 44 20  f5 3a e3 58 3d 31 b8 31  |. ...pD .:.X=1.1|
00001cd0  32 3a ff 22 43 48 41 4e  4e 45 4c 56 4f 49 43 45  |2:."CHANNELVOICE|
00001ce0  20 31 20 22 2b c3 58 3a  d4 31 2c 2d 31 30 2c 35  | 1 "+.X:.1,-10,5|
00001cf0  32 2c 31 30 30 3a e3 52  3d 30 b8 31 30 30 30 30  |2,100:.R=0.10000|
00001d00  3a ed 2c 3a fd 20 a3 0d  ff                       |:.,:. ...|
00001d09
BioBot/BBReal2.m0
BioBot/BBReal2.m1
BioBot/BBReal2.m2
BioBot/BBReal2.m4
BioBot/BBReal2.m5