Home » Personal collection » Acorn hard disk » files » BallBot » BioBot/BallBot2

BioBot/BallBot2

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 hard disk » files » BallBot
Filename: BioBot/BallBot2
Read OK:
File size: 1586 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
   10 REM BallBot V1.0
   20 REM (C) Dominic Ford 1997
   30 :
   40 REM Setup variables
   50 VOICE 1,"StringLib-Soft":*STEREO 1 0
   60 VOICE 2,"StringLib-Soft":*STEREO 2 -127
   70 VOICE 3,"StringLib-Soft":*STEREO 3 127
   80 current=0:DIMball(4,1):bbx=640:bby=950:dir=270:PROCsetupbb
   90 MODE0:MOUSE ON:PROCdrawfull
  100 :
  110 REM Start main loop
  120 REPEAT:T=TIME
  130 PROCuser
  140 IF idle THEN UNTIL FALSE
  150 PROCsense
  160 mov=FNai(freqa,freqb,freqc)
  170 fwd=(mov AND 1)<>0
  180 reverse=(mov AND 2)<>0
  190 left=(mov AND 4)<>0
  200 right=(mov AND 8)<>0
  210 PROCmoveit
  220 REPEAT UNTIL INKEY(-99)
  230 UNTIL FALSE
  240 :
  250 REM Graphic interface
  260 DEFPROCdrawfull
  270 CLS:GCOL0,1:RECTANGLE0,0,1279,1023
  280 MOVE 640,100:DRAW 640,924
  290 PROCdrawmini
  300 ENDPROC
  310 :
  320 REM Draw ballbot and balls
  330 DEFPROCdrawmini
  340 GCOL3,1:FORb=0TO4
  350 IF ball(b,0)<>0 OR ball(b,1)<>0 THEN POINT ball(b,0),ball(b,1)
  360 NEXT
  370 GCOL3,1:POINTbbx,bby
  380 ENDPROC
  390 :
  400 REM Reset to test a new biobot
  410 DEFPROCrestart
  420 stage=0:bbx=640:bby=950:dir=270
  430 FORr=0TO4:REPEAT:ball(r,0)=100+RND(1000):ball(r,1)=100+RND(800)
  440 IF ball(r,0)<670 AND ball(r,1)>620 THEN UNTIL FALSE
  450 UNTIL TRUE:NEXT
  460 PROCdrawfull
  470 ENDPROC
  480 :
  490 REM User interface (putting balls down)
  500 DEFPROCuser
  510 MOUSE x,y,c
  520 IF c=0 THEN ENDPROC
  530 IF (c AND 4)<>0 THEN PROCdrawmini:ball(current,0)=x:ball(current,1)=y:current=(current+1)MOD5:PROCdrawmini
  540 IF (c AND 2)<>0 THEN idle=FALSE:stage=0
  550 REPEAT
  560 MOUSE x,y,c
  570 UNTIL c=0
  580 ENDPROC
  590 :
  600 REM Calculate ballbot's new position
  610 DEFPROCmoveit
  620 IF left THEN dir=dir-2.5
  630 IF right THEN dir=dir+2.5
  640 :
  650 REM Get direction in range 0<theta<360
  660 REPEAT IF dir<0 THEN dir=dir+360
  670 IF dir>=360 THEN dir=dir-360
  680 UNTIL dir>=0 AND dir<360
  690 :
  700 fr=0:IF fwd THEN fr=fr+0.5
  710 IF reverse THEN fr=fr-0.5
  720 PROCdrawmini:bbx=bbx+5*SIN(PI*dir/180)*fr
  730 bby=bby+5*COS(PI*dir/180)*fr
  740 FORball=0TO4:IF ABS(bbx-ball(ball,0))<10 AND ABS(bby-ball(ball,1))<10 THEN ball(ball,0)=0
  750 NEXT:PROCdrawmini
  760 ENDPROC
  770 :
  780 REM Calculate ballbot's background echo reading (-balls)
  790 DEFFNback(x,y,freq)
  800 REM Calculate Angle of net as seen by Ballbot
  810 LOCAL freqa
  820 netlow=(FNangle(640,923,x,y)-dir) MOD 360
  830 IF netlow<0 THEN netlow=netlow+360
  840 IF netlow>180 THEN netlow=netlow-360
  850 nethi=(FNangle(640,100,x,y)-dir) MOD 360
  860 IF nethi<0 THEN nethi=nethi+360
  870 IF nethi>180 THEN nethi=nethi-360
  880 :
  890 REM Calculate reading
  900 freqa=freq+RND(6)-3
  910 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)
  920 =freqa
  930 :
  940 REM Calculate Ballbot's readings (MAIN ROUTINE)
  950 :
  960 DEFPROCsense
  970 REM Get background readings from FNback
  980 freq=RND(250)+1500:fa$="U":fb$=fa$:fc$=fa$
  990 freqa=FNback(bbx,bby,freq)
 1000 dir=dir-5:freqb=FNback(bbx,bby,freq)
 1010 dir=dir+10:freqc=FNback(bbx,bby,freq):dir=dir-5
 1020 :
 1030 REM Add any relevant balls to readings (using hairy trigonometry)
 1040 :
 1050 FORball=0TO4
 1060 d%=SQR((ball(ball,0)-bbx)^2+(ball(ball,1)-bby)^2)
 1070 IF ball(ball,0)=0 THEN d%=9999
 1080 a=FNangle(ball(ball,0),ball(ball,1),bbx,bby)-dir
 1090 IF ABS(a)<5 AND freqa>d% THEN freqa=d%:fa$="B"
 1100 IF a>-16 AND a<=-5 AND freqb>d% THEN freqb=d%:fb$="B"
 1110 IF a>=5 AND a<16 AND freqc>d% THEN freqc=d%:fc$="B"
 1120 PRINTTAB(0,ball);a
 1130 NEXT
 1140 :
 1150 REM Update user displays
 1160 :
 1170 PRINTTAB(0,31)fb$,fa$,fc$,stage,INT(searching),left,right;
 1180 SOUND 1,-1,freqa/4,5:SOUND 2,-1,freqb/4,5:SOUND 3,-1,freqc/4,5
 1190 ENDPROC
 1200:
 1210 REM Calculate bearing of B from A
 1220 DEFFNangle(x1,y1,x2,y2)
 1230 IF y2=y1 THEN ang=90 ELSE ang=180*ATN((x2-x1)/(y2-y1))/PI
 1240 IF (y2>y1) THEN ang=ang+180
 1250 =ang MOD 360
 1260 :
 1270 REM BALLBOT ROBOTIC INTELLIGENCE MODULE
 1280 :
 1290 DEFFNai(freqa,freqb,freqc)
 1300 REM Artificial intelligence routines (ie. What Next??)
 1310 LOCALfwd,reverse,left,right
 1320 fwd=TRUE:reverse=FALSE:left=FALSE:right=FALSE
 1330 :
 1340 REM What stage are we in? Hunt for balls or move to new area?
 1350 :
 1360 IF near<>0 AND stage<8 THEN PROCdonearstuff
 1370 IF near=0 AND (stage=0 OR stage=2 OR stage=4 OR stage=6) THEN PROChunt
 1380 IF near=0 AND (stage=1 OR stage=5) THEN PROCwaitmove
 1390 IF near=0 AND (stage=3 OR stage=7) THEN PROCmoveout
 1400 IF stage=8 THEN PROCreleaseb
 1410 feed=0:IF fwd THEN feed=feed+1
 1420 IF reverse THEN feed=feed+2
 1430 IF left THEN feed=feed+4
 1440 IF right THEN feed=feed+8
 1450 =feed
 1460 :
 1470 REM Perform a sweep to find any balls
 1480 DEFPROChunt
 1490 IF (freqa<20 AND freqb<20 AND freqc<20) OR (reving AND freqa<100 AND freqb<100 AND freqc<100) THEN searching=0:reving=TRUE:reverse=TRUE:fwd=FALSE:left=FALSE:right=FALSE:ENDPROC
 1500 REM IF (freqa<freqb AND freqa<freqc) OR (freqa>freqb AND freqa>freqc) THEN d=TRUE ELSE d=FALSE
 1510 reving=FALSE
 1520 IF fa$="B" THEN searching=searching/2:ENDPROC
 1530 IF fb$="B" THEN left=TRUE:ENDPROC
 1540 IF fc$="B" THEN right=TRUE:ENDPROC
 1550 searching=searching+1:IF searching<5 THEN right=TRUE ELSE left=TRUE
 1560 IF searching>150 THEN stage=stage+1
 1570 ENDPROC
 1580 :
 1590 REM Move to next hunt
 1600 DEFPROCwaitmove
 1610 searching=searching+1:IFsearching>159 THEN stage=stage+1:searching=0
 1620 IF freqa>40 THEN forward=TRUE ELSE stage=stage+1:searching=0
 1630 ENDPROC
 1640 :
 1650 REM Find edge of net and aim for it to move to other side
 1660 DEFPROCmoveout
 1670 IF (freqa<30 OR freqb<30 OR freqc<30) OR (reving AND (freqa<125 OR freqb<125 OR freqc<125)) THEN searching=searching/2:reving=TRUE:reverse=TRUE:fwd=FALSE:left=FALSE:right=FALSE:ENDPROC
 1680 reving=FALSE
 1690 IF freqb<40 AND freqa>250 THEN right=TRUE:near=1:ENDPROC
 1700 IF freqa<200 AND freqb<200 AND freqc<200 THEN right=TRUE:ENDPROC
 1710 IF (freqb*1.5)<freqc AND (freqa*1.5)<freqc THEN right=TRUE:ENDPROC
 1720 IF (freqb*1.5)>freqc THEN left=TRUE:ENDPROC
 1730 ENDPROC
 1740 :
 1750 REM Nearly there... Just need a little nudge in the right direction.
 1760 DEFPROCdonearstuff
 1770 near=near+1
 1780 IF near<8 THEN right=TRUE:ENDPROC
 1790 left=TRUE
 1800 IF near>16 THEN near=0:stage=stage+1:searching=0
 1810 ENDPROC
 1820 :
 1830 DEFPROCsetupbb
 1840 reving=FALSE:left=FALSE:right=FALSE:fwd=FALSE:reverse=FALSE:searching=0:idle=TRUE
 1850 near=FALSE
 1860 ENDPROC
 1870 :
 1880 DEFPROCreleaseb
 1890 REM Got all the balls, now just dump them!
 1900 near=near+1:reverse=TRUE:fwd=FALSE
 1910 IF near>9 THEN idle=TRUE:near=FALSE
 1920 ENDPROC
 1930 REPEAT:FORX=1TO12:OSCLI"CHANNELVOICE 1 "+STR$X:SOUND1,-10,52,100:FORR=0TO10000:NEXT,:UNTIL FALSE

 � BallBot V1.0
 � (C) Dominic Ford 1997
 :
( � Setup variables
2& ȡ 1,"StringLib-Soft":*STEREO 1 0
<) ȡ 2,"StringLib-Soft":*STEREO 2 -127
F( ȡ 3,"StringLib-Soft":*STEREO 3 127
P: current=0:�ball(4,1):bbx=640:bby=950:dir=270:�setupbb
Z �0:ȗ �:�drawfull
d :
n � Start main loop
x
 �: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
� �moveit
� � � �(-99)
� � �
� :
� � Graphic interface
 ��drawfull
 �:�0,1:ȓ0,0,1279,1023
 � 640,100:� 640,924
" �drawmini
, �
6 :
@ � Draw ballbot and balls
J ��drawmini
T �3,1:�b=0�4
^; � ball(b,0)<>0 � ball(b,1)<>0 � Ȓ ball(b,0),ball(b,1)
h �
r �3,1:Ȓbbx,bby
| �
� :
�! � Reset to test a new biobot
� ��restart
�$ stage=0:bbx=640:bby=950:dir=270
�8 �r=0�4:�:ball(r,0)=100+�(1000):ball(r,1)=100+�(800)
�* � ball(r,0)<670 � ball(r,1)>620 � � �
�
 � �:�
� �drawfull
� �
� :
�* � User interface (putting balls down)
� ��user
�
 ȗ x,y,c
 � 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
& �
0
 ȗ x,y,c
:
 � c=0
D �
N :
X' � Calculate ballbot's new position
b
 ��moveit
l � left � dir=dir-2.5
v � right � dir=dir+2.5
� :
�) � 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.5
� � reverse � fr=fr-0.5
�( �drawmini:bbx=bbx+5*�(�*dir/180)*fr
� bby=bby+5*�(�*dir/180)*fr
�Q �ball=0�4:� �(bbx-ball(ball,0))<10 � �(bby-ball(ball,1))<10 � ball(ball,0)=0
� �:�drawmini
� �
 :
; � Calculate ballbot's background echo reading (-balls)
 ݤback(x,y,freq)
 0 � Calculate Angle of net as seen by Ballbot
* � freqa
4+ netlow=(�angle(640,923,x,y)-dir) � 360
># � netlow<0 � netlow=netlow+360
H% � netlow>180 � netlow=netlow-360
R* nethi=(�angle(640,100,x,y)-dir) � 360
\  � nethi<0 � nethi=nethi+360
f" � nethi>180 � nethi=nethi-360
p :
z � 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)
� :
� ��sense
�* � Get background readings from FNback
�- freq=�(250)+1500:fa$="U":fb$=fa$:fc$=fa$
� freqa=�back(bbx,bby,freq)
�( dir=dir-5:freqb=�back(bbx,bby,freq)
�3 dir=dir+10:freqc=�back(bbx,bby,freq):dir=dir-5
� :
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
84 a=�angle(ball(ball,0),ball(ball,1),bbx,bby)-dir
B+ � �(a)<5 � freqa>d% � freqa=d%:fa$="B"
L2 � a>-16 � a<=-5 � freqb>d% � freqb=d%:fb$="B"
V0 � a>=5 � a<16 � freqc>d% � freqc=d%:fc$="B"
` �0,ball);a
j �
t :
~ � Update user displays
� :
�6 �0,31)fb$,fa$,fc$,stage,�(searching),left,right;
�7 � 1,-1,freqa/4,5:� 2,-1,freqb/4,5:� 3,-1,freqc/4,5
� �
�:
�$ � Calculate bearing of B from A
� ݤangle(x1,y1,x2,y2)
�4 � y2=y1 � ang=90 � ang=180*�((x2-x1)/(y2-y1))/�
� � (y2>y1) � ang=ang+180
� =ang � 360
� :
�* � BALLBOT ROBOTIC INTELLIGENCE MODULE
 :

 ݤai(freqa,freqb,freqc)
9 � Artificial intelligence routines (ie. What Next??)
 �fwd,reverse,left,right
(# fwd=�:reverse=�:left=�:right=�
2 :
<@ � What stage are we in? Hunt for balls or move to new area?
F :
P' � near<>0 � stage<8 � �donearstuff
Z? � near=0 � (stage=0 � stage=2 � stage=4 � stage=6) � �hunt
d/ � near=0 � (stage=1 � stage=5) � �waitmove
n. � near=0 � (stage=3 � stage=7) � �moveout
x � stage=8 � �releaseb
� feed=0:� fwd � feed=feed+1
� � reverse � feed=feed+2
� � left � feed=feed+4
� � right � feed=feed+8
�
 =feed
� :
�( � Perform a sweep to find any balls
� ��hunt
Ҏ � (freqa<20 � freqb<20 � freqc<20) � (reving � freqa<100 � freqb<100 � freqc<100) � searching=0:reving=�:reverse=�:fwd=�:left=�:right=�:�
�a � IF (freqa<freqb AND freqa<freqc) OR (freqa>freqb AND freqa>freqc) THEN d=TRUE ELSE d=FALSE
�
 reving=�
�( � fa$="B" � searching=searching/2:�
� � fb$="B" � left=�:�
 � fc$="B" � right=�:�
; searching=searching+1:� searching<5 � right=� � left=�
$ � searching>150 � stage=stage+1
" �
, :
6 � Move to next hunt
@ ��waitmove
JE searching=searching+1:�searching>159 � stage=stage+1:searching=0
T7 � freqa>40 � forward=� � stage=stage+1:searching=0
^ �
h :
r< � Find edge of net and aim for it to move to other side
| ��moveout
�� � (freqa<30 � freqb<30 � freqc<30) � (reving � (freqa<125 � freqb<125 � freqc<125)) � searching=searching/2:reving=�:reverse=�:fwd=�:left=�:right=�:�
�
 reving=�
�. � freqb<40 � freqa>250 � right=�:near=1:�
�4 � freqa<200 � freqb<200 � freqc<200 � right=�:�
�8 � (freqb*1.5)<freqc � (freqa*1.5)<freqc � right=�:�
�# � (freqb*1.5)>freqc � left=�:�
� �
� :
�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
 �
 :
& ��setupbb
0? reving=�:left=�:right=�:fwd=�:reverse=�:searching=0:idle=�
: near=�
D �
N :
X ��releaseb
b- � Got all the balls, now just dump them!
l  near=near+1:reverse=�:fwd=�
v � near>9 � idle=�:near=�
� �
�D �:�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  31 2e 30 0d 00 14 1c 20  f4 20 28 43 29 20 44 6f  |1.0.... . (C) Do|
00000020  6d 69 6e 69 63 20 46 6f  72 64 20 31 39 39 37 0d  |minic Ford 1997.|
00000030  00 1e 06 20 3a 0d 00 28  16 20 f4 20 53 65 74 75  |... :..(. . Setu|
00000040  70 20 76 61 72 69 61 62  6c 65 73 0d 00 32 26 20  |p variables..2& |
00000050  c8 a1 20 31 2c 22 53 74  72 69 6e 67 4c 69 62 2d  |.. 1,"StringLib-|
00000060  53 6f 66 74 22 3a 2a 53  54 45 52 45 4f 20 31 20  |Soft":*STEREO 1 |
00000070  30 0d 00 3c 29 20 c8 a1  20 32 2c 22 53 74 72 69  |0..<) .. 2,"Stri|
00000080  6e 67 4c 69 62 2d 53 6f  66 74 22 3a 2a 53 54 45  |ngLib-Soft":*STE|
00000090  52 45 4f 20 32 20 2d 31  32 37 0d 00 46 28 20 c8  |REO 2 -127..F( .|
000000a0  a1 20 33 2c 22 53 74 72  69 6e 67 4c 69 62 2d 53  |. 3,"StringLib-S|
000000b0  6f 66 74 22 3a 2a 53 54  45 52 45 4f 20 33 20 31  |oft":*STEREO 3 1|
000000c0  32 37 0d 00 50 3a 20 63  75 72 72 65 6e 74 3d 30  |27..P: current=0|
000000d0  3a de 62 61 6c 6c 28 34  2c 31 29 3a 62 62 78 3d  |:.ball(4,1):bbx=|
000000e0  36 34 30 3a 62 62 79 3d  39 35 30 3a 64 69 72 3d  |640:bby=950:dir=|
000000f0  32 37 30 3a f2 73 65 74  75 70 62 62 0d 00 5a 16  |270:.setupbb..Z.|
00000100  20 eb 30 3a c8 97 20 ee  3a f2 64 72 61 77 66 75  | .0:.. .:.drawfu|
00000110  6c 6c 0d 00 64 06 20 3a  0d 00 6e 16 20 f4 20 53  |ll..d. :..n. . S|
00000120  74 61 72 74 20 6d 61 69  6e 20 6c 6f 6f 70 0d 00  |tart main loop..|
00000130  78 0a 20 f5 3a 54 3d 91  0d 00 82 0a 20 f2 75 73  |x. .:T=..... .us|
00000140  65 72 0d 00 8c 11 20 e7  20 69 64 6c 65 20 8c 20  |er.... . idle . |
00000150  fd 20 a3 0d 00 96 0b 20  f2 73 65 6e 73 65 0d 00  |. ..... .sense..|
00000160  a0 1f 20 6d 6f 76 3d a4  61 69 28 66 72 65 71 61  |.. mov=.ai(freqa|
00000170  2c 66 72 65 71 62 2c 66  72 65 71 63 29 0d 00 aa  |,freqb,freqc)...|
00000180  15 20 66 77 64 3d 28 6d  6f 76 20 80 20 31 29 3c  |. fwd=(mov . 1)<|
00000190  3e 30 0d 00 b4 19 20 72  65 76 65 72 73 65 3d 28  |>0.... reverse=(|
000001a0  6d 6f 76 20 80 20 32 29  3c 3e 30 0d 00 be 16 20  |mov . 2)<>0.... |
000001b0  6c 65 66 74 3d 28 6d 6f  76 20 80 20 34 29 3c 3e  |left=(mov . 4)<>|
000001c0  30 0d 00 c8 17 20 72 69  67 68 74 3d 28 6d 6f 76  |0.... right=(mov|
000001d0  20 80 20 38 29 3c 3e 30  0d 00 d2 0c 20 f2 6d 6f  | . 8)<>0.... .mo|
000001e0  76 65 69 74 0d 00 dc 0f  20 f5 20 fd 20 a6 28 2d  |veit.... . . .(-|
000001f0  39 39 29 0d 00 e6 08 20  fd 20 a3 0d 00 f0 06 20  |99).... . ..... |
00000200  3a 0d 00 fa 18 20 f4 20  47 72 61 70 68 69 63 20  |:.... . Graphic |
00000210  69 6e 74 65 72 66 61 63  65 0d 01 04 0f 20 dd f2  |interface.... ..|
00000220  64 72 61 77 66 75 6c 6c  0d 01 0e 1b 20 db 3a e6  |drawfull.... .:.|
00000230  30 2c 31 3a c8 93 30 2c  30 2c 31 32 37 39 2c 31  |0,1:..0,0,1279,1|
00000240  30 32 33 0d 01 18 18 20  ec 20 36 34 30 2c 31 30  |023.... . 640,10|
00000250  30 3a df 20 36 34 30 2c  39 32 34 0d 01 22 0e 20  |0:. 640,924..". |
00000260  f2 64 72 61 77 6d 69 6e  69 0d 01 2c 06 20 e1 0d  |.drawmini..,. ..|
00000270  01 36 06 20 3a 0d 01 40  1d 20 f4 20 44 72 61 77  |.6. :..@. . Draw|
00000280  20 62 61 6c 6c 62 6f 74  20 61 6e 64 20 62 61 6c  | ballbot and bal|
00000290  6c 73 0d 01 4a 0f 20 dd  f2 64 72 61 77 6d 69 6e  |ls..J. ..drawmin|
000002a0  69 0d 01 54 10 20 e6 33  2c 31 3a e3 62 3d 30 b8  |i..T. .3,1:.b=0.|
000002b0  34 0d 01 5e 3b 20 e7 20  62 61 6c 6c 28 62 2c 30  |4..^; . ball(b,0|
000002c0  29 3c 3e 30 20 84 20 62  61 6c 6c 28 62 2c 31 29  |)<>0 . ball(b,1)|
000002d0  3c 3e 30 20 8c 20 c8 92  20 62 61 6c 6c 28 62 2c  |<>0 . .. ball(b,|
000002e0  30 29 2c 62 61 6c 6c 28  62 2c 31 29 0d 01 68 06  |0),ball(b,1)..h.|
000002f0  20 ed 0d 01 72 13 20 e6  33 2c 31 3a c8 92 62 62  | ...r. .3,1:..bb|
00000300  78 2c 62 62 79 0d 01 7c  06 20 e1 0d 01 86 06 20  |x,bby..|. ..... |
00000310  3a 0d 01 90 21 20 f4 20  52 65 73 65 74 20 74 6f  |:...! . Reset to|
00000320  20 74 65 73 74 20 61 20  6e 65 77 20 62 69 6f 62  | test a new biob|
00000330  6f 74 0d 01 9a 0e 20 dd  f2 72 65 73 74 61 72 74  |ot.... ..restart|
00000340  0d 01 a4 24 20 73 74 61  67 65 3d 30 3a 62 62 78  |...$ stage=0:bbx|
00000350  3d 36 34 30 3a 62 62 79  3d 39 35 30 3a 64 69 72  |=640:bby=950:dir|
00000360  3d 32 37 30 0d 01 ae 38  20 e3 72 3d 30 b8 34 3a  |=270...8 .r=0.4:|
00000370  f5 3a 62 61 6c 6c 28 72  2c 30 29 3d 31 30 30 2b  |.:ball(r,0)=100+|
00000380  b3 28 31 30 30 30 29 3a  62 61 6c 6c 28 72 2c 31  |.(1000):ball(r,1|
00000390  29 3d 31 30 30 2b b3 28  38 30 30 29 0d 01 b8 2a  |)=100+.(800)...*|
000003a0  20 e7 20 62 61 6c 6c 28  72 2c 30 29 3c 36 37 30  | . ball(r,0)<670|
000003b0  20 80 20 62 61 6c 6c 28  72 2c 31 29 3e 36 32 30  | . ball(r,1)>620|
000003c0  20 8c 20 fd 20 a3 0d 01  c2 0a 20 fd 20 b9 3a ed  | . . ..... . .:.|
000003d0  0d 01 cc 0e 20 f2 64 72  61 77 66 75 6c 6c 0d 01  |.... .drawfull..|
000003e0  d6 06 20 e1 0d 01 e0 06  20 3a 0d 01 ea 2a 20 f4  |.. ..... :...* .|
000003f0  20 55 73 65 72 20 69 6e  74 65 72 66 61 63 65 20  | User interface |
00000400  28 70 75 74 74 69 6e 67  20 62 61 6c 6c 73 20 64  |(putting balls d|
00000410  6f 77 6e 29 0d 01 f4 0b  20 dd f2 75 73 65 72 0d  |own).... ..user.|
00000420  01 fe 0d 20 c8 97 20 78  2c 79 2c 63 0d 02 08 0e  |... .. x,y,c....|
00000430  20 e7 20 63 3d 30 20 8c  20 e1 0d 02 12 61 20 e7  | . c=0 . ....a .|
00000440  20 28 63 20 80 20 34 29  3c 3e 30 20 8c 20 f2 64  | (c . 4)<>0 . .d|
00000450  72 61 77 6d 69 6e 69 3a  62 61 6c 6c 28 63 75 72  |rawmini:ball(cur|
00000460  72 65 6e 74 2c 30 29 3d  78 3a 62 61 6c 6c 28 63  |rent,0)=x:ball(c|
00000470  75 72 72 65 6e 74 2c 31  29 3d 79 3a 63 75 72 72  |urrent,1)=y:curr|
00000480  65 6e 74 3d 28 63 75 72  72 65 6e 74 2b 31 29 83  |ent=(current+1).|
00000490  35 3a f2 64 72 61 77 6d  69 6e 69 0d 02 1c 22 20  |5:.drawmini..." |
000004a0  e7 20 28 63 20 80 20 32  29 3c 3e 30 20 8c 20 69  |. (c . 2)<>0 . i|
000004b0  64 6c 65 3d a3 3a 73 74  61 67 65 3d 30 0d 02 26  |dle=.:stage=0..&|
000004c0  06 20 f5 0d 02 30 0d 20  c8 97 20 78 2c 79 2c 63  |. ...0. .. x,y,c|
000004d0  0d 02 3a 0a 20 fd 20 63  3d 30 0d 02 44 06 20 e1  |..:. . c=0..D. .|
000004e0  0d 02 4e 06 20 3a 0d 02  58 27 20 f4 20 43 61 6c  |..N. :..X' . Cal|
000004f0  63 75 6c 61 74 65 20 62  61 6c 6c 62 6f 74 27 73  |culate ballbot's|
00000500  20 6e 65 77 20 70 6f 73  69 74 69 6f 6e 0d 02 62  | new position..b|
00000510  0d 20 dd f2 6d 6f 76 65  69 74 0d 02 6c 19 20 e7  |. ..moveit..l. .|
00000520  20 6c 65 66 74 20 8c 20  64 69 72 3d 64 69 72 2d  | left . dir=dir-|
00000530  32 2e 35 0d 02 76 1a 20  e7 20 72 69 67 68 74 20  |2.5..v. . right |
00000540  8c 20 64 69 72 3d 64 69  72 2b 32 2e 35 0d 02 80  |. dir=dir+2.5...|
00000550  06 20 3a 0d 02 8a 29 20  f4 20 47 65 74 20 64 69  |. :...) . Get di|
00000560  72 65 63 74 69 6f 6e 20  69 6e 20 72 61 6e 67 65  |rection in range|
00000570  20 30 3c 74 68 65 74 61  3c 33 36 30 0d 02 94 1c  | 0<theta<360....|
00000580  20 f5 20 e7 20 64 69 72  3c 30 20 8c 20 64 69 72  | . . dir<0 . dir|
00000590  3d 64 69 72 2b 33 36 30  0d 02 9e 1d 20 e7 20 64  |=dir+360.... . d|
000005a0  69 72 3e 3d 33 36 30 20  8c 20 64 69 72 3d 64 69  |ir>=360 . dir=di|
000005b0  72 2d 33 36 30 0d 02 a8  17 20 fd 20 64 69 72 3e  |r-360.... . dir>|
000005c0  3d 30 20 80 20 64 69 72  3c 33 36 30 0d 02 b2 06  |=0 . dir<360....|
000005d0  20 3a 0d 02 bc 1b 20 66  72 3d 30 3a e7 20 66 77  | :.... fr=0:. fw|
000005e0  64 20 8c 20 66 72 3d 66  72 2b 30 2e 35 0d 02 c6  |d . fr=fr+0.5...|
000005f0  1a 20 e7 20 72 65 76 65  72 73 65 20 8c 20 66 72  |. . reverse . fr|
00000600  3d 66 72 2d 30 2e 35 0d  02 d0 28 20 f2 64 72 61  |=fr-0.5...( .dra|
00000610  77 6d 69 6e 69 3a 62 62  78 3d 62 62 78 2b 35 2a  |wmini:bbx=bbx+5*|
00000620  b5 28 af 2a 64 69 72 2f  31 38 30 29 2a 66 72 0d  |.(.*dir/180)*fr.|
00000630  02 da 1e 20 62 62 79 3d  62 62 79 2b 35 2a 9b 28  |... bby=bby+5*.(|
00000640  af 2a 64 69 72 2f 31 38  30 29 2a 66 72 0d 02 e4  |.*dir/180)*fr...|
00000650  51 20 e3 62 61 6c 6c 3d  30 b8 34 3a e7 20 94 28  |Q .ball=0.4:. .(|
00000660  62 62 78 2d 62 61 6c 6c  28 62 61 6c 6c 2c 30 29  |bbx-ball(ball,0)|
00000670  29 3c 31 30 20 80 20 94  28 62 62 79 2d 62 61 6c  |)<10 . .(bby-bal|
00000680  6c 28 62 61 6c 6c 2c 31  29 29 3c 31 30 20 8c 20  |l(ball,1))<10 . |
00000690  62 61 6c 6c 28 62 61 6c  6c 2c 30 29 3d 30 0d 02  |ball(ball,0)=0..|
000006a0  ee 10 20 ed 3a f2 64 72  61 77 6d 69 6e 69 0d 02  |.. .:.drawmini..|
000006b0  f8 06 20 e1 0d 03 02 06  20 3a 0d 03 0c 3b 20 f4  |.. ..... :...; .|
000006c0  20 43 61 6c 63 75 6c 61  74 65 20 62 61 6c 6c 62  | Calculate ballb|
000006d0  6f 74 27 73 20 62 61 63  6b 67 72 6f 75 6e 64 20  |ot's background |
000006e0  65 63 68 6f 20 72 65 61  64 69 6e 67 20 28 2d 62  |echo reading (-b|
000006f0  61 6c 6c 73 29 0d 03 16  15 20 dd a4 62 61 63 6b  |alls).... ..back|
00000700  28 78 2c 79 2c 66 72 65  71 29 0d 03 20 30 20 f4  |(x,y,freq).. 0 .|
00000710  20 43 61 6c 63 75 6c 61  74 65 20 41 6e 67 6c 65  | Calculate Angle|
00000720  20 6f 66 20 6e 65 74 20  61 73 20 73 65 65 6e 20  | of net as seen |
00000730  62 79 20 42 61 6c 6c 62  6f 74 0d 03 2a 0c 20 ea  |by Ballbot..*. .|
00000740  20 66 72 65 71 61 0d 03  34 2b 20 6e 65 74 6c 6f  | freqa..4+ netlo|
00000750  77 3d 28 a4 61 6e 67 6c  65 28 36 34 30 2c 39 32  |w=(.angle(640,92|
00000760  33 2c 78 2c 79 29 2d 64  69 72 29 20 83 20 33 36  |3,x,y)-dir) . 36|
00000770  30 0d 03 3e 23 20 e7 20  6e 65 74 6c 6f 77 3c 30  |0..># . netlow<0|
00000780  20 8c 20 6e 65 74 6c 6f  77 3d 6e 65 74 6c 6f 77  | . netlow=netlow|
00000790  2b 33 36 30 0d 03 48 25  20 e7 20 6e 65 74 6c 6f  |+360..H% . netlo|
000007a0  77 3e 31 38 30 20 8c 20  6e 65 74 6c 6f 77 3d 6e  |w>180 . netlow=n|
000007b0  65 74 6c 6f 77 2d 33 36  30 0d 03 52 2a 20 6e 65  |etlow-360..R* ne|
000007c0  74 68 69 3d 28 a4 61 6e  67 6c 65 28 36 34 30 2c  |thi=(.angle(640,|
000007d0  31 30 30 2c 78 2c 79 29  2d 64 69 72 29 20 83 20  |100,x,y)-dir) . |
000007e0  33 36 30 0d 03 5c 20 20  e7 20 6e 65 74 68 69 3c  |360..\  . nethi<|
000007f0  30 20 8c 20 6e 65 74 68  69 3d 6e 65 74 68 69 2b  |0 . nethi=nethi+|
00000800  33 36 30 0d 03 66 22 20  e7 20 6e 65 74 68 69 3e  |360..f" . nethi>|
00000810  31 38 30 20 8c 20 6e 65  74 68 69 3d 6e 65 74 68  |180 . nethi=neth|
00000820  69 2d 33 36 30 0d 03 70  06 20 3a 0d 03 7a 18 20  |i-360..p. :..z. |
00000830  f4 20 43 61 6c 63 75 6c  61 74 65 20 72 65 61 64  |. Calculate read|
00000840  69 6e 67 0d 03 84 16 20  66 72 65 71 61 3d 66 72  |ing.... freqa=fr|
00000850  65 71 2b b3 28 36 29 2d  33 0d 03 8e 83 20 e7 20  |eq+.(6)-3.... . |
00000860  94 28 b5 28 af 2a 64 69  72 2f 31 38 30 29 29 3e  |.(.(.*dir/180))>|
00000870  30 2e 30 31 20 8c 20 e7  20 28 28 6e 65 74 6c 6f  |0.01 . . ((netlo|
00000880  77 3c 30 20 80 20 6e 65  74 68 69 3e 30 29 20 84  |w<0 . nethi>0) .|
00000890  20 28 6e 65 74 68 69 3c  30 20 80 20 6e 65 74 6c  | (nethi<0 . netl|
000008a0  6f 77 3e 30 29 29 20 80  20 28 36 34 30 2d 78 29  |ow>0)) . (640-x)|
000008b0  2f b5 28 af 2a 64 69 72  2f 31 38 30 29 3e 30 20  |/.(.*dir/180)>0 |
000008c0  8c 20 66 72 65 71 61 3d  28 36 34 30 2d 78 29 2f  |. freqa=(640-x)/|
000008d0  b5 28 af 2a 64 69 72 2f  31 38 30 29 0d 03 98 0b  |.(.*dir/180)....|
000008e0  20 3d 66 72 65 71 61 0d  03 a2 06 20 3a 0d 03 ac  | =freqa.... :...|
000008f0  32 20 f4 20 43 61 6c 63  75 6c 61 74 65 20 42 61  |2 . Calculate Ba|
00000900  6c 6c 62 6f 74 27 73 20  72 65 61 64 69 6e 67 73  |llbot's readings|
00000910  20 28 4d 41 49 4e 20 52  4f 55 54 49 4e 45 29 0d  | (MAIN ROUTINE).|
00000920  03 b6 06 20 3a 0d 03 c0  0c 20 dd f2 73 65 6e 73  |... :.... ..sens|
00000930  65 0d 03 ca 2a 20 f4 20  47 65 74 20 62 61 63 6b  |e...* . Get back|
00000940  67 72 6f 75 6e 64 20 72  65 61 64 69 6e 67 73 20  |ground readings |
00000950  66 72 6f 6d 20 46 4e 62  61 63 6b 0d 03 d4 2d 20  |from FNback...- |
00000960  66 72 65 71 3d b3 28 32  35 30 29 2b 31 35 30 30  |freq=.(250)+1500|
00000970  3a 66 61 24 3d 22 55 22  3a 66 62 24 3d 66 61 24  |:fa$="U":fb$=fa$|
00000980  3a 66 63 24 3d 66 61 24  0d 03 de 1e 20 66 72 65  |:fc$=fa$.... fre|
00000990  71 61 3d a4 62 61 63 6b  28 62 62 78 2c 62 62 79  |qa=.back(bbx,bby|
000009a0  2c 66 72 65 71 29 0d 03  e8 28 20 64 69 72 3d 64  |,freq)...( dir=d|
000009b0  69 72 2d 35 3a 66 72 65  71 62 3d a4 62 61 63 6b  |ir-5:freqb=.back|
000009c0  28 62 62 78 2c 62 62 79  2c 66 72 65 71 29 0d 03  |(bbx,bby,freq)..|
000009d0  f2 33 20 64 69 72 3d 64  69 72 2b 31 30 3a 66 72  |.3 dir=dir+10:fr|
000009e0  65 71 63 3d a4 62 61 63  6b 28 62 62 78 2c 62 62  |eqc=.back(bbx,bb|
000009f0  79 2c 66 72 65 71 29 3a  64 69 72 3d 64 69 72 2d  |y,freq):dir=dir-|
00000a00  35 0d 03 fc 06 20 3a 0d  04 06 44 20 f4 20 41 64  |5.... :...D . Ad|
00000a10  64 20 61 6e 79 20 72 65  6c 65 76 61 6e 74 20 62  |d any relevant b|
00000a20  61 6c 6c 73 20 74 6f 20  72 65 61 64 69 6e 67 73  |alls to readings|
00000a30  20 28 75 73 69 6e 67 20  68 61 69 72 79 20 74 72  | (using hairy tr|
00000a40  69 67 6f 6e 6f 6d 65 74  72 79 29 0d 04 10 06 20  |igonometry).... |
00000a50  3a 0d 04 1a 0e 20 e3 62  61 6c 6c 3d 30 b8 34 0d  |:.... .ball=0.4.|
00000a60  04 24 34 20 64 25 3d b6  28 28 62 61 6c 6c 28 62  |.$4 d%=.((ball(b|
00000a70  61 6c 6c 2c 30 29 2d 62  62 78 29 5e 32 2b 28 62  |all,0)-bbx)^2+(b|
00000a80  61 6c 6c 28 62 61 6c 6c  2c 31 29 2d 62 62 79 29  |all(ball,1)-bby)|
00000a90  5e 32 29 0d 04 2e 1f 20  e7 20 62 61 6c 6c 28 62  |^2).... . ball(b|
00000aa0  61 6c 6c 2c 30 29 3d 30  20 8c 20 64 25 3d 39 39  |all,0)=0 . d%=99|
00000ab0  39 39 0d 04 38 34 20 61  3d a4 61 6e 67 6c 65 28  |99..84 a=.angle(|
00000ac0  62 61 6c 6c 28 62 61 6c  6c 2c 30 29 2c 62 61 6c  |ball(ball,0),bal|
00000ad0  6c 28 62 61 6c 6c 2c 31  29 2c 62 62 78 2c 62 62  |l(ball,1),bbx,bb|
00000ae0  79 29 2d 64 69 72 0d 04  42 2b 20 e7 20 94 28 61  |y)-dir..B+ . .(a|
00000af0  29 3c 35 20 80 20 66 72  65 71 61 3e 64 25 20 8c  |)<5 . freqa>d% .|
00000b00  20 66 72 65 71 61 3d 64  25 3a 66 61 24 3d 22 42  | freqa=d%:fa$="B|
00000b10  22 0d 04 4c 32 20 e7 20  61 3e 2d 31 36 20 80 20  |"..L2 . a>-16 . |
00000b20  61 3c 3d 2d 35 20 80 20  66 72 65 71 62 3e 64 25  |a<=-5 . freqb>d%|
00000b30  20 8c 20 66 72 65 71 62  3d 64 25 3a 66 62 24 3d  | . freqb=d%:fb$=|
00000b40  22 42 22 0d 04 56 30 20  e7 20 61 3e 3d 35 20 80  |"B"..V0 . a>=5 .|
00000b50  20 61 3c 31 36 20 80 20  66 72 65 71 63 3e 64 25  | a<16 . freqc>d%|
00000b60  20 8c 20 66 72 65 71 63  3d 64 25 3a 66 63 24 3d  | . freqc=d%:fc$=|
00000b70  22 42 22 0d 04 60 10 20  f1 8a 30 2c 62 61 6c 6c  |"B"..`. ..0,ball|
00000b80  29 3b 61 0d 04 6a 06 20  ed 0d 04 74 06 20 3a 0d  |);a..j. ...t. :.|
00000b90  04 7e 1b 20 f4 20 55 70  64 61 74 65 20 75 73 65  |.~. . Update use|
00000ba0  72 20 64 69 73 70 6c 61  79 73 0d 04 88 06 20 3a  |r displays.... :|
00000bb0  0d 04 92 36 20 f1 8a 30  2c 33 31 29 66 62 24 2c  |...6 ..0,31)fb$,|
00000bc0  66 61 24 2c 66 63 24 2c  73 74 61 67 65 2c a8 28  |fa$,fc$,stage,.(|
00000bd0  73 65 61 72 63 68 69 6e  67 29 2c 6c 65 66 74 2c  |searching),left,|
00000be0  72 69 67 68 74 3b 0d 04  9c 37 20 d4 20 31 2c 2d  |right;...7 . 1,-|
00000bf0  31 2c 66 72 65 71 61 2f  34 2c 35 3a d4 20 32 2c  |1,freqa/4,5:. 2,|
00000c00  2d 31 2c 66 72 65 71 62  2f 34 2c 35 3a d4 20 33  |-1,freqb/4,5:. 3|
00000c10  2c 2d 31 2c 66 72 65 71  63 2f 34 2c 35 0d 04 a6  |,-1,freqc/4,5...|
00000c20  06 20 e1 0d 04 b0 05 3a  0d 04 ba 24 20 f4 20 43  |. .....:...$ . C|
00000c30  61 6c 63 75 6c 61 74 65  20 62 65 61 72 69 6e 67  |alculate bearing|
00000c40  20 6f 66 20 42 20 66 72  6f 6d 20 41 0d 04 c4 19  | of B from A....|
00000c50  20 dd a4 61 6e 67 6c 65  28 78 31 2c 79 31 2c 78  | ..angle(x1,y1,x|
00000c60  32 2c 79 32 29 0d 04 ce  34 20 e7 20 79 32 3d 79  |2,y2)...4 . y2=y|
00000c70  31 20 8c 20 61 6e 67 3d  39 30 20 8b 20 61 6e 67  |1 . ang=90 . ang|
00000c80  3d 31 38 30 2a 99 28 28  78 32 2d 78 31 29 2f 28  |=180*.((x2-x1)/(|
00000c90  79 32 2d 79 31 29 29 2f  af 0d 04 d8 1c 20 e7 20  |y2-y1))/..... . |
00000ca0  28 79 32 3e 79 31 29 20  8c 20 61 6e 67 3d 61 6e  |(y2>y1) . ang=an|
00000cb0  67 2b 31 38 30 0d 04 e2  0f 20 3d 61 6e 67 20 83  |g+180.... =ang .|
00000cc0  20 33 36 30 0d 04 ec 06  20 3a 0d 04 f6 2a 20 f4  | 360.... :...* .|
00000cd0  20 42 41 4c 4c 42 4f 54  20 52 4f 42 4f 54 49 43  | BALLBOT ROBOTIC|
00000ce0  20 49 4e 54 45 4c 4c 49  47 45 4e 43 45 20 4d 4f  | INTELLIGENCE MO|
00000cf0  44 55 4c 45 0d 05 00 06  20 3a 0d 05 0a 1c 20 dd  |DULE.... :.... .|
00000d00  a4 61 69 28 66 72 65 71  61 2c 66 72 65 71 62 2c  |.ai(freqa,freqb,|
00000d10  66 72 65 71 63 29 0d 05  14 39 20 f4 20 41 72 74  |freqc)...9 . Art|
00000d20  69 66 69 63 69 61 6c 20  69 6e 74 65 6c 6c 69 67  |ificial intellig|
00000d30  65 6e 63 65 20 72 6f 75  74 69 6e 65 73 20 28 69  |ence routines (i|
00000d40  65 2e 20 57 68 61 74 20  4e 65 78 74 3f 3f 29 0d  |e. What Next??).|
00000d50  05 1e 1c 20 ea 66 77 64  2c 72 65 76 65 72 73 65  |... .fwd,reverse|
00000d60  2c 6c 65 66 74 2c 72 69  67 68 74 0d 05 28 23 20  |,left,right..(# |
00000d70  66 77 64 3d b9 3a 72 65  76 65 72 73 65 3d a3 3a  |fwd=.:reverse=.:|
00000d80  6c 65 66 74 3d a3 3a 72  69 67 68 74 3d a3 0d 05  |left=.:right=...|
00000d90  32 06 20 3a 0d 05 3c 40  20 f4 20 57 68 61 74 20  |2. :..<@ . What |
00000da0  73 74 61 67 65 20 61 72  65 20 77 65 20 69 6e 3f  |stage are we in?|
00000db0  20 48 75 6e 74 20 66 6f  72 20 62 61 6c 6c 73 20  | Hunt for balls |
00000dc0  6f 72 20 6d 6f 76 65 20  74 6f 20 6e 65 77 20 61  |or move to new a|
00000dd0  72 65 61 3f 0d 05 46 06  20 3a 0d 05 50 27 20 e7  |rea?..F. :..P' .|
00000de0  20 6e 65 61 72 3c 3e 30  20 80 20 73 74 61 67 65  | near<>0 . stage|
00000df0  3c 38 20 8c 20 f2 64 6f  6e 65 61 72 73 74 75 66  |<8 . .donearstuf|
00000e00  66 0d 05 5a 3f 20 e7 20  6e 65 61 72 3d 30 20 80  |f..Z? . near=0 .|
00000e10  20 28 73 74 61 67 65 3d  30 20 84 20 73 74 61 67  | (stage=0 . stag|
00000e20  65 3d 32 20 84 20 73 74  61 67 65 3d 34 20 84 20  |e=2 . stage=4 . |
00000e30  73 74 61 67 65 3d 36 29  20 8c 20 f2 68 75 6e 74  |stage=6) . .hunt|
00000e40  0d 05 64 2f 20 e7 20 6e  65 61 72 3d 30 20 80 20  |..d/ . near=0 . |
00000e50  28 73 74 61 67 65 3d 31  20 84 20 73 74 61 67 65  |(stage=1 . stage|
00000e60  3d 35 29 20 8c 20 f2 77  61 69 74 6d 6f 76 65 0d  |=5) . .waitmove.|
00000e70  05 6e 2e 20 e7 20 6e 65  61 72 3d 30 20 80 20 28  |.n. . near=0 . (|
00000e80  73 74 61 67 65 3d 33 20  84 20 73 74 61 67 65 3d  |stage=3 . stage=|
00000e90  37 29 20 8c 20 f2 6d 6f  76 65 6f 75 74 0d 05 78  |7) . .moveout..x|
00000ea0  1a 20 e7 20 73 74 61 67  65 3d 38 20 8c 20 f2 72  |. . stage=8 . .r|
00000eb0  65 6c 65 61 73 65 62 0d  05 82 1f 20 66 65 65 64  |eleaseb.... feed|
00000ec0  3d 30 3a e7 20 66 77 64  20 8c 20 66 65 65 64 3d  |=0:. fwd . feed=|
00000ed0  66 65 65 64 2b 31 0d 05  8c 1c 20 e7 20 72 65 76  |feed+1.... . rev|
00000ee0  65 72 73 65 20 8c 20 66  65 65 64 3d 66 65 65 64  |erse . feed=feed|
00000ef0  2b 32 0d 05 96 19 20 e7  20 6c 65 66 74 20 8c 20  |+2.... . left . |
00000f00  66 65 65 64 3d 66 65 65  64 2b 34 0d 05 a0 1a 20  |feed=feed+4.... |
00000f10  e7 20 72 69 67 68 74 20  8c 20 66 65 65 64 3d 66  |. right . feed=f|
00000f20  65 65 64 2b 38 0d 05 aa  0a 20 3d 66 65 65 64 0d  |eed+8.... =feed.|
00000f30  05 b4 06 20 3a 0d 05 be  28 20 f4 20 50 65 72 66  |... :...( . Perf|
00000f40  6f 72 6d 20 61 20 73 77  65 65 70 20 74 6f 20 66  |orm a sweep to f|
00000f50  69 6e 64 20 61 6e 79 20  62 61 6c 6c 73 0d 05 c8  |ind any balls...|
00000f60  0b 20 dd f2 68 75 6e 74  0d 05 d2 8e 20 e7 20 28  |. ..hunt.... . (|
00000f70  66 72 65 71 61 3c 32 30  20 80 20 66 72 65 71 62  |freqa<20 . freqb|
00000f80  3c 32 30 20 80 20 66 72  65 71 63 3c 32 30 29 20  |<20 . freqc<20) |
00000f90  84 20 28 72 65 76 69 6e  67 20 80 20 66 72 65 71  |. (reving . freq|
00000fa0  61 3c 31 30 30 20 80 20  66 72 65 71 62 3c 31 30  |a<100 . freqb<10|
00000fb0  30 20 80 20 66 72 65 71  63 3c 31 30 30 29 20 8c  |0 . freqc<100) .|
00000fc0  20 73 65 61 72 63 68 69  6e 67 3d 30 3a 72 65 76  | searching=0:rev|
00000fd0  69 6e 67 3d b9 3a 72 65  76 65 72 73 65 3d b9 3a  |ing=.:reverse=.:|
00000fe0  66 77 64 3d a3 3a 6c 65  66 74 3d a3 3a 72 69 67  |fwd=.:left=.:rig|
00000ff0  68 74 3d a3 3a e1 0d 05  dc 61 20 f4 20 49 46 20  |ht=.:....a . IF |
00001000  28 66 72 65 71 61 3c 66  72 65 71 62 20 41 4e 44  |(freqa<freqb AND|
00001010  20 66 72 65 71 61 3c 66  72 65 71 63 29 20 4f 52  | freqa<freqc) OR|
00001020  20 28 66 72 65 71 61 3e  66 72 65 71 62 20 41 4e  | (freqa>freqb AN|
00001030  44 20 66 72 65 71 61 3e  66 72 65 71 63 29 20 54  |D freqa>freqc) T|
00001040  48 45 4e 20 64 3d 54 52  55 45 20 45 4c 53 45 20  |HEN d=TRUE ELSE |
00001050  64 3d 46 41 4c 53 45 0d  05 e6 0d 20 72 65 76 69  |d=FALSE.... revi|
00001060  6e 67 3d a3 0d 05 f0 28  20 e7 20 66 61 24 3d 22  |ng=....( . fa$="|
00001070  42 22 20 8c 20 73 65 61  72 63 68 69 6e 67 3d 73  |B" . searching=s|
00001080  65 61 72 63 68 69 6e 67  2f 32 3a e1 0d 05 fa 19  |earching/2:.....|
00001090  20 e7 20 66 62 24 3d 22  42 22 20 8c 20 6c 65 66  | . fb$="B" . lef|
000010a0  74 3d b9 3a e1 0d 06 04  1a 20 e7 20 66 63 24 3d  |t=.:..... . fc$=|
000010b0  22 42 22 20 8c 20 72 69  67 68 74 3d b9 3a e1 0d  |"B" . right=.:..|
000010c0  06 0e 3b 20 73 65 61 72  63 68 69 6e 67 3d 73 65  |..; searching=se|
000010d0  61 72 63 68 69 6e 67 2b  31 3a e7 20 73 65 61 72  |arching+1:. sear|
000010e0  63 68 69 6e 67 3c 35 20  8c 20 72 69 67 68 74 3d  |ching<5 . right=|
000010f0  b9 20 8b 20 6c 65 66 74  3d b9 0d 06 18 24 20 e7  |. . left=....$ .|
00001100  20 73 65 61 72 63 68 69  6e 67 3e 31 35 30 20 8c  | searching>150 .|
00001110  20 73 74 61 67 65 3d 73  74 61 67 65 2b 31 0d 06  | stage=stage+1..|
00001120  22 06 20 e1 0d 06 2c 06  20 3a 0d 06 36 18 20 f4  |". ...,. :..6. .|
00001130  20 4d 6f 76 65 20 74 6f  20 6e 65 78 74 20 68 75  | Move to next hu|
00001140  6e 74 0d 06 40 0f 20 dd  f2 77 61 69 74 6d 6f 76  |nt..@. ..waitmov|
00001150  65 0d 06 4a 45 20 73 65  61 72 63 68 69 6e 67 3d  |e..JE searching=|
00001160  73 65 61 72 63 68 69 6e  67 2b 31 3a e7 73 65 61  |searching+1:.sea|
00001170  72 63 68 69 6e 67 3e 31  35 39 20 8c 20 73 74 61  |rching>159 . sta|
00001180  67 65 3d 73 74 61 67 65  2b 31 3a 73 65 61 72 63  |ge=stage+1:searc|
00001190  68 69 6e 67 3d 30 0d 06  54 37 20 e7 20 66 72 65  |hing=0..T7 . fre|
000011a0  71 61 3e 34 30 20 8c 20  66 6f 72 77 61 72 64 3d  |qa>40 . forward=|
000011b0  b9 20 8b 20 73 74 61 67  65 3d 73 74 61 67 65 2b  |. . stage=stage+|
000011c0  31 3a 73 65 61 72 63 68  69 6e 67 3d 30 0d 06 5e  |1:searching=0..^|
000011d0  06 20 e1 0d 06 68 06 20  3a 0d 06 72 3c 20 f4 20  |. ...h. :..r< . |
000011e0  46 69 6e 64 20 65 64 67  65 20 6f 66 20 6e 65 74  |Find edge of net|
000011f0  20 61 6e 64 20 61 69 6d  20 66 6f 72 20 69 74 20  | and aim for it |
00001200  74 6f 20 6d 6f 76 65 20  74 6f 20 6f 74 68 65 72  |to move to other|
00001210  20 73 69 64 65 0d 06 7c  0e 20 dd f2 6d 6f 76 65  | side..|. ..move|
00001220  6f 75 74 0d 06 86 9a 20  e7 20 28 66 72 65 71 61  |out.... . (freqa|
00001230  3c 33 30 20 84 20 66 72  65 71 62 3c 33 30 20 84  |<30 . freqb<30 .|
00001240  20 66 72 65 71 63 3c 33  30 29 20 84 20 28 72 65  | freqc<30) . (re|
00001250  76 69 6e 67 20 80 20 28  66 72 65 71 61 3c 31 32  |ving . (freqa<12|
00001260  35 20 84 20 66 72 65 71  62 3c 31 32 35 20 84 20  |5 . freqb<125 . |
00001270  66 72 65 71 63 3c 31 32  35 29 29 20 8c 20 73 65  |freqc<125)) . se|
00001280  61 72 63 68 69 6e 67 3d  73 65 61 72 63 68 69 6e  |arching=searchin|
00001290  67 2f 32 3a 72 65 76 69  6e 67 3d b9 3a 72 65 76  |g/2:reving=.:rev|
000012a0  65 72 73 65 3d b9 3a 66  77 64 3d a3 3a 6c 65 66  |erse=.:fwd=.:lef|
000012b0  74 3d a3 3a 72 69 67 68  74 3d a3 3a e1 0d 06 90  |t=.:right=.:....|
000012c0  0d 20 72 65 76 69 6e 67  3d a3 0d 06 9a 2e 20 e7  |. reving=..... .|
000012d0  20 66 72 65 71 62 3c 34  30 20 80 20 66 72 65 71  | freqb<40 . freq|
000012e0  61 3e 32 35 30 20 8c 20  72 69 67 68 74 3d b9 3a  |a>250 . right=.:|
000012f0  6e 65 61 72 3d 31 3a e1  0d 06 a4 34 20 e7 20 66  |near=1:....4 . f|
00001300  72 65 71 61 3c 32 30 30  20 80 20 66 72 65 71 62  |reqa<200 . freqb|
00001310  3c 32 30 30 20 80 20 66  72 65 71 63 3c 32 30 30  |<200 . freqc<200|
00001320  20 8c 20 72 69 67 68 74  3d b9 3a e1 0d 06 ae 38  | . right=.:....8|
00001330  20 e7 20 28 66 72 65 71  62 2a 31 2e 35 29 3c 66  | . (freqb*1.5)<f|
00001340  72 65 71 63 20 80 20 28  66 72 65 71 61 2a 31 2e  |reqc . (freqa*1.|
00001350  35 29 3c 66 72 65 71 63  20 8c 20 72 69 67 68 74  |5)<freqc . right|
00001360  3d b9 3a e1 0d 06 b8 23  20 e7 20 28 66 72 65 71  |=.:....# . (freq|
00001370  62 2a 31 2e 35 29 3e 66  72 65 71 63 20 8c 20 6c  |b*1.5)>freqc . l|
00001380  65 66 74 3d b9 3a e1 0d  06 c2 06 20 e1 0d 06 cc  |eft=.:..... ....|
00001390  06 20 3a 0d 06 d6 47 20  f4 20 4e 65 61 72 6c 79  |. :...G . Nearly|
000013a0  20 74 68 65 72 65 2e 2e  2e 20 4a 75 73 74 20 6e  | there... Just n|
000013b0  65 65 64 20 61 20 6c 69  74 74 6c 65 20 6e 75 64  |eed a little nud|
000013c0  67 65 20 69 6e 20 74 68  65 20 72 69 67 68 74 20  |ge in the right |
000013d0  64 69 72 65 63 74 69 6f  6e 2e 0d 06 e0 12 20 dd  |direction..... .|
000013e0  f2 64 6f 6e 65 61 72 73  74 75 66 66 0d 06 ea 10  |.donearstuff....|
000013f0  20 6e 65 61 72 3d 6e 65  61 72 2b 31 0d 06 f4 19  | near=near+1....|
00001400  20 e7 20 6e 65 61 72 3c  38 20 8c 20 72 69 67 68  | . near<8 . righ|
00001410  74 3d b9 3a e1 0d 06 fe  0b 20 6c 65 66 74 3d b9  |t=.:..... left=.|
00001420  0d 07 08 31 20 e7 20 6e  65 61 72 3e 31 36 20 8c  |...1 . near>16 .|
00001430  20 6e 65 61 72 3d 30 3a  73 74 61 67 65 3d 73 74  | near=0:stage=st|
00001440  61 67 65 2b 31 3a 73 65  61 72 63 68 69 6e 67 3d  |age+1:searching=|
00001450  30 0d 07 12 06 20 e1 0d  07 1c 06 20 3a 0d 07 26  |0.... ..... :..&|
00001460  0e 20 dd f2 73 65 74 75  70 62 62 0d 07 30 3f 20  |. ..setupbb..0? |
00001470  72 65 76 69 6e 67 3d a3  3a 6c 65 66 74 3d a3 3a  |reving=.:left=.:|
00001480  72 69 67 68 74 3d a3 3a  66 77 64 3d a3 3a 72 65  |right=.:fwd=.:re|
00001490  76 65 72 73 65 3d a3 3a  73 65 61 72 63 68 69 6e  |verse=.:searchin|
000014a0  67 3d 30 3a 69 64 6c 65  3d b9 0d 07 3a 0b 20 6e  |g=0:idle=...:. n|
000014b0  65 61 72 3d a3 0d 07 44  06 20 e1 0d 07 4e 06 20  |ear=...D. ...N. |
000014c0  3a 0d 07 58 0f 20 dd f2  72 65 6c 65 61 73 65 62  |:..X. ..releaseb|
000014d0  0d 07 62 2d 20 f4 20 47  6f 74 20 61 6c 6c 20 74  |..b- . Got all t|
000014e0  68 65 20 62 61 6c 6c 73  2c 20 6e 6f 77 20 6a 75  |he balls, now ju|
000014f0  73 74 20 64 75 6d 70 20  74 68 65 6d 21 0d 07 6c  |st dump them!..l|
00001500  20 20 6e 65 61 72 3d 6e  65 61 72 2b 31 3a 72 65  |  near=near+1:re|
00001510  76 65 72 73 65 3d b9 3a  66 77 64 3d a3 0d 07 76  |verse=.:fwd=...v|
00001520  1d 20 e7 20 6e 65 61 72  3e 39 20 8c 20 69 64 6c  |. . near>9 . idl|
00001530  65 3d b9 3a 6e 65 61 72  3d a3 0d 07 80 06 20 e1  |e=.:near=..... .|
00001540  0d 07 8a 44 20 f5 3a e3  58 3d 31 b8 31 32 3a ff  |...D .:.X=1.12:.|
00001550  22 43 48 41 4e 4e 45 4c  56 4f 49 43 45 20 31 20  |"CHANNELVOICE 1 |
00001560  22 2b c3 58 3a d4 31 2c  2d 31 30 2c 35 32 2c 31  |"+.X:.1,-10,52,1|
00001570  30 30 3a e3 52 3d 30 b8  31 30 30 30 30 3a ed 2c  |00:.R=0.10000:.,|
00001580  3a fd 20 a3 0d ff                                 |:. ...|
00001586