Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_Dominic_4.adf » BioBot/BBNew

BioBot/BBNew

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 » Greaseweazled » adfs_Dominic_4.adf
Filename: BioBot/BBNew
Read OK:
File size: 2582 bytes
Load address: FFFFFB42
Exec address: D33F43F3
Duplicates

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

File contents
   10 REM BallBot V3.0
   20 REM Real-Time Version with Continuous Testing Option
   30 REM (C) Dominic Ford 1997
   40 :
   50 REM Welcome screen
   60 MODE6:@%=&905:PRINT" BallBot Artificial Intelligence Module"'"Simulation Tester V3.0 Real Time Version"''"Programmed and Designed by Dominic Ford"''SPC(16);"(C) 1997"
   70 PRINT'''"1. Real-Time Simulation"''"2. Logged Continuous Runs"''"3. Do specific run"
   80 REPEAT type$=GET$:UNTIL type$="1" OR type$="2" OR type$="3"
   90 :
  100 REM Setup variables
  105 ON ERROR OSCLI"CLOSE":REPORT:PRINT" at line ";ERL:END
  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:IF type$="1" THEN MOUSE ON:PROCdrawfull
  155 IF type$="2" THEN start=TIME:stage=0:idle=FALSE:INPUT"Filename";f$:OSCLI"SPOOL "+f$
  157 IF type$="3" THEN PRINT"Enter Data:"':FORb=0TO4:PRINT"Ball ";b+1;:INPUTball(b,0),ball(b,1):NEXT:type$="1":MOUSE ON:PROCdrawfull
  160 :
  170 REM Start main loop
  180 REPEAT:T=TIME
  190 IF type$="1" THEN PROCuser ELSE PROCcompmon
  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 open=(mov AND 32)<>0
  290 PROCmoveit
  300 REPEAT UNTIL TIME>(T+30)
  310 UNTIL FALSE
  320 :
  330 REM Graphic interface
  340 DEFPROCdrawfull
  350 REM Set up constants
  360 LOCALsx,sy,width
  370 sx=1:sy=2:width=10
  380 REM Draw green court area
  390 CLS:GCOL0,%000100:RECTANGLE FILL 0,0,1279,1023
  400 REM Mark out white lines onto court
  410 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
  420 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
  430 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
  440 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
  450 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
  460 :
  470 REM Draw net
  480 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
  490 GCOL0,%111111:MOVE 682,142:DRAW682,966
  500 PROCdrawmini
  510 ENDPROC
  520 :
  530 REM Draw ballbot and balls
  540 DEFPROCdrawmini
  550 IF type$="2" THEN ENDPROC
  560 GCOL3,%001011:FORb=0TO4
  570 IF ball(b,0)<>0 OR ball(b,1)<>0 THEN RECTANGLE FILL ball(b,0),ball(b,1),5,5
  580 NEXT
  590 GCOL3,%000111:RECTANGLE FILL bbx,bby,5,5
  600 ENDPROC
  610 :
  620 REM User interface (putting balls down)
  630 DEFPROCuser
  640 MOUSE x,y,c
  650 IF c=0 THEN ENDPROC
  660 IF (c AND 4)<>0 THEN PROCdrawmini:ball(current,0)=x:ball(current,1)=y:current=(current+1)MOD5:PROCdrawmini
  670 IF (c AND 2)<>0 THEN idle=FALSE:stage=0:start=TIME
  680 REPEAT
  690 MOUSE x,y,c
  700 UNTIL c=0
  710 ENDPROC
  720 :
  730 REM Calculate ballbot's new position
  740 DEFPROCmoveit
  750 IF (left AND fwd) OR (right AND reverse) THEN dir=dir-2.5*(1-3*turbo)
  760 IF (right AND fwd) OR (left AND reverse) THEN dir=dir+2.5*(1-3*turbo)
  770 :
  780 REM Get direction in range 0<theta<360
  790 REPEAT IF dir<0 THEN dir=dir+360
  800 IF dir>=360 THEN dir=dir-360
  810 UNTIL dir>=0 AND dir<360
  820 :
  830 fr=0:IF fwd THEN fr=fr+0.25
  840 IF reverse THEN fr=fr-0.25
  850 IF turbo THEN fr=fr*4
  860 PROCdrawmini:bbx=bbx+16*SIN(PI*dir/180)*fr
  870 bby=bby+16*COS(PI*dir/180)*fr
  880 FORball=0TO4:IF open AND ABS(bbx-ball(ball,0))<10 AND ABS(bby-ball(ball,1))<10 THEN ball(ball,0)=0
  890 NEXT:PROCdrawmini
  900 ENDPROC
  910 :
  920 REM Calculate ballbot's background echo reading (-balls), using several points to check out where net posts are.
  930 DEFFNback(x,y,freq)
  940 LOCAL freqa,dummy
  950 freqa=FNback2(x,y,freq,100,923):ftype$=ft$
  960 IF ft$="U" THEN =freqa
  970 dummy=FNback2(x,y,freq,100,125):IF ft$="N" AND dummy<=freqa THEN ftype$="P"
  980 dummy=FNback2(x,y,freq,898,923):IF ft$="N" AND dummy<=freqa THEN ftype$="P"
  990 =freqa
 1000 :
 1010 REM Calculate reading from one point
 1020 DEFFNback2(x,y,freq,min,max)
 1030 ft$="U":REM Set up general value of frequency type (UNIDENTIFIED)
 1040 REM Calculate Angle of net as seen by Ballbot
 1050 LOCAL freqa
 1060 netlow=(FNangle(640,max,x,y)-dir) MOD 360
 1070 IF netlow<0 THEN netlow=netlow+360
 1080 IF netlow>180 THEN netlow=netlow-360
 1090 nethi=(FNangle(640,min,x,y)-dir) MOD 360
 1100 IF nethi<0 THEN nethi=nethi+360
 1110 IF nethi>180 THEN nethi=nethi-360
 1120 :
 1130 REM Calculate reading
 1140 freqa=freq+RND(6)-3
 1150 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):ft$="N"
 1160 =freqa
 1170 :
 1180 REM Calculate Ballbot's readings (MAIN ROUTINE)
 1190 :
 1200 DEFPROCsense
 1210 REM Get background readings from FNback
 1220 freq=RND(250)+1500
 1230 freqa=FNback(bbx,bby,freq):fa$=ftype$
 1240 dir=dir-30:freqb=FNback(bbx,bby,freq):fb$=ftype$
 1250 dir=dir+60:freqc=FNback(bbx,bby,freq):fc$=ftype$
 1260 dir=dir-105:freqd=FNback(bbx,bby,freq):dir=dir+75:fd$=ftype$
 1270 :
 1280 REM Add any relevant balls to readings (using hairy trigonometry)
 1290 :
 1300 FORball=0TO4
 1310 d%=SQR((ball(ball,0)-bbx)^2+(ball(ball,1)-bby)^2)
 1320 IF ball(ball,0)=0 THEN d%=9999
 1330 a=FNangle(ball(ball,0),ball(ball,1),bbx,bby)-dir:IFa>180 THEN a=a-360
 1340 IF ABS(a)<15 AND freqa>d% THEN freqa=d%:fa$="B"
 1350 IF a>-46 AND a<=-15 AND freqb>d% THEN freqb=d%:fb$="B"
 1360 IF a>=15 AND a<46 AND freqc>d% THEN freqc=d%:fc$="B"
 1370 IF a>-90 AND a<=-46 AND freqd>d% THEN freqd=d%:fd$="B"
 1380 NEXT
 1390 :
 1400 REM Update user displays
 1410 :
 1420 IF type$="2" THEN ENDPROC
 1430 PRINTTAB(0,0)INT((TIME-start)/12000);":";(INT((TIME-start)/200)MOD60);" "
 1440 PRINTTAB(0,31)fd$,fb$,fa$,fc$,stage,INT(searching),left,right,opencter;
 1450 SOUND 1,-1,freqa/4,5:SOUND 2,-1,freqb/4,5:SOUND 3,-1,freqc/4,5
 1460 ENDPROC
 1470:
 1480 REM Calculate bearing of B from A
 1490 DEFFNangle(x1,y1,x2,y2)
 1500 IF y2=y1 THEN ang=90 ELSE ang=180*ATN((x2-x1)/(y2-y1))/PI
 1510 IF (y2>y1) THEN ang=ang+180
 1520 IF ang<0 THEN ang=ang+360
 1530 =ang MOD 360
 1540 :
 1550 REM Computer Monitor of BallBot's progress
 1560 DEFPROCcompmon
 1565 IF idle AND (ball(0,0)<>0 OR ball(1,0)<>0 OR ball(2,0)<>0 OR ball(3,0)<>0 OR ball(4,0)<>0) THEN st$="Fail" ELSE st$="Pass"
 1570 IF idle THEN PRINTst$,INT((TIME-start)/12000);":";(INT((TIME-start)/200)MOD60)
 1580 IF TIME>start+48000 THEN idle=TRUE:PRINT"Time","****"
 1590 IFbbx>630ANDbbx<650ANDbby>100ANDbby<923THENidle=TRUE:PRINT"Crash","****"
 1600 IF idle THEN bbx=640:bby=950:dir=270:stage=0:PROCsetupbb:start=TIME:FORb=0TO4:ball(b,0)=RND(1280):ball(b,1)=RND(1024):NEXT
 1605 IF idle THEN PRINT"[";ball(0,0);",";ball(0,1);"] [";ball(1,0);",";ball(1,1);"] [";ball(2,0);",";ball(2,1);"] [";ball(3,0);",";ball(3,1);"] [";ball(4,0);",";ball(4,1);"]",;:idle=FALSE
 1610 ENDPROC
 1620 :
 1630 REM BALLBOT ROBOTIC INTELLIGENCE MODULE
 1640 :
 1650 DEFFNai(freqa,freqb,freqc)
 1660 REM Artificial intelligence routines (ie. What Next??)
 1670 LOCALfwd,reverse,left,right,turbo
 1680 fwd=TRUE:reverse=FALSE:left=FALSE:right=FALSE:turbo=FALSE
 1690 :
 1700 REM What stage are we in? Hunt for balls or move to new area?
 1710 IF near<>0 AND stage<8 THEN PROCdonearstuff
 1720 IF near=0 AND (stage=0 OR stage=2) THEN PROChunt
 1730 IF near=0 AND (stage=1 OR stage=3) THEN PROCmoveout
 1740 IF stage=4 THEN PROCreleaseb
 1750 :
 1760 REM Prepare output into binary for transmission
 1770 feed=0:IF fwd THEN feed=feed+1
 1780 IF reving THEN turbo=TRUE
 1790 IF reverse THEN feed=feed+2
 1800 IF left THEN feed=feed+4
 1810 IF right THEN feed=feed+8
 1820 IF turbo THEN feed=feed+16
 1830 IF opencter>0 THEN feed=feed+32
 1840 =feed
 1850 :
 1860 REM Perform a sweep to find any balls
 1870 DEFPROChunt
 1880 REM Watch out if too near to net
 1890 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=TRUE:ENDPROC
 1900 reving=FALSE
 1910 :
 1920 REM If Ball is out of reach in the "D" sector, reverse!
 1930 FDR=freqd*1.25:IFfreqd<150ANDfd$="B"ANDFDR<freqa ANDFDR<freqb ANDFDR<freqc AND(fa$<>"B"ORfreqa>100)AND(fb$<>"B"ORfreqb>100)AND(fc$<>"B"ORfreqc>100)THEN turbo=TRUE:reverse=TRUE:fwd=FALSE:right=TRUE:farleft=-6*(freqd>40):ENDPROC
 1940 IF farleft>0 THEN
 1950  farleft=farleft-1:reverse=TRUE:fwd=FALSE:right=TRUE:turbo=TRUE
 1960  IF fa$="B" OR (fd$<>"B" AND fb$<>"B") THEN farleft=0
 1970  ENDPROC
 1980 ENDIF
 1990 :
 2000 REM Rotate to face ball
 2002 IF (fb$="B" AND freqb>150) OR (fd$="B" AND freqd>150) THEN tending=0
 2003 IF fc$="B" AND freqc>150 THEN tending=1
 2005 IF opencter>0 THEN opencter=opencter-1:ENDPROC
 2010 opencter=-5*(((freqa<20)ANDfa$="B")OR((freqb<20)ANDfb$="B")OR((freqc<20)ANDfc$="B")OR((freqd<20)ANDfd$="B"))
 2020 IF fa$="B" THEN left=(steer=-1):right=(steer=1):steer=0:searching=searching/2:turbo=freqa>100:ENDPROC
 2030 IF fb$="B" OR fd$="B" THEN steer=-1:left=TRUE:ENDPROC
 2040 IF fc$="B" THEN steer=1:right=TRUE:ENDPROC
 2050 REM If no ball in sight, continue rotation...
 2060 align=FALSE:searching=searching+1
 2070 IF (tending AND 1)<>0 THEN right=TRUE ELSE left=TRUE
 2080 IF searching=5 THEN tending=(tending EOR 1)
 2100 IF searching>150 THEN stage=stage+1
 2110 ENDPROC
 2120 :
 2130 REM Find edge of net and aim for it to move to other side
 2140 DEFPROCmoveout
 2150 REM Watch out if too near to net
 2160 IF (freqa<30 OR freqb<30 OR freqc<30) OR (reving AND (freqa<250 OR freqb<250 OR freqc<250)) THEN reving=TRUE:farleft=0:reverse=TRUE:fwd=FALSE:right=FALSE:left=(freqa>230 AND freqb>230 AND freqc>230):ENDPROC
 2170 reving=FALSE
 2180 REM Align ballbot to face the net post...
 2190 IF fa$="N" OR fa$="P" THEN right=TRUE:ENDPROC
 2200 IF fb$<>"N" AND fb$<>"P" THEN left=TRUE:ENDPROC
 2210 IF fb$="P" AND freqb<150 THEN right=TRUE:near=1:ENDPROC
 2220 turbo=TRUE
 2260 ENDPROC
 2270 :
 2280 REM Nearly there... Just need a little nudge in the right direction.
 2290 DEFPROCdonearstuff
 2300 near=near+1
 2310 IF near<8 THEN right=TRUE:ENDPROC
 2320 left=TRUE
 2330 IF near>16 THEN near=0:stage=stage+1:searching=0:tending=1
 2340 ENDPROC
 2350 :
 2360 REM Initialise BallBot variables at the beginning of a run
 2370 DEFPROCsetupbb
 2380 reving=FALSE:left=FALSE:right=FALSE:fwd=FALSE:reverse=FALSE:searching=0:idle=TRUE
 2390 near=FALSE:farleft=0:opencter=0:tending=1:steer=0
 2400 ENDPROC
 2410 :
 2420 DEFPROCreleaseb
 2430 REM Got all the balls, now just dump them!
 2440 near=near+1:reverse=TRUE:fwd=FALSE
 2450 IF near>9 THEN idle=TRUE:near=FALSE
 2460 ENDPROC
 2470 REPEAT:FORX=1TO12:OSCLI"CHANNELVOICE 1 "+STR$X:SOUND1,-10,52,100:FORR=0TO10000:NEXT,:UNTIL FALSE
 2480 :
 2490 REM Whizz-back to line up with D - what if whizz back into net?
 2500 REM Reverse if BallBot knows that balls are behind it.

 � BallBot V3.0
7 � Real-Time Version with Continuous Testing Option
 � (C) Dominic Ford 1997
( :
2 � Welcome screen
<� �6:@%=&905:�" BallBot Artificial Intelligence Module"'"Simulation Tester V3.0 Real Time Version"''"Programmed and Designed by Dominic Ford"''�(16);"(C) 1997"
FU �'''"1. Real-Time Simulation"''"2. Logged Continuous Runs"''"3. Do specific run"
P2 � type$=�:� type$="1" � type$="2" � type$="3"
Z :
d � Setup variables
i$ � � �"CLOSE":�:�" at line ";�:�
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:� type$="1" � ȗ �:�drawfull
�E � type$="2" � start=�:stage=0:idle=�:�"Filename";f$:�"SPOOL "+f$
�g � type$="3" � �"Enter Data:"':�b=0�4:�"Ball ";b+1;:�ball(b,0),ball(b,1):�:type$="1":ȗ �:�drawfull
� :
� � Start main loop
�
 �:T=�
�# � type$="1" � �user � �compmon
� � 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
 open=(mov � 32)<>0
" �moveit
, � � �>(T+30)
6 � �
@ :
J � Graphic interface
T ��drawfull
^ � Set up constants
h �sx,sy,width
r sx=1:sy=2:width=10
| � Draw green court area
�% �:�0,%000100:ȓ Ȑ 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
& � type$="2" � �
0 �3,%001011:�b=0�4
:B � ball(b,0)<>0 � ball(b,1)<>0 � ȓ Ȑ ball(b,0),ball(b,1),5,5
D �
N! �3,%000111:ȓ Ȑ bbx,bby,5,5
X �
b :
l* � User interface (putting balls down)
v ��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: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
4 :
> fr=0:� fwd � fr=fr+0.25
H � reverse � fr=fr-0.25
R � turbo � fr=fr*4
\) �drawmini:bbx=bbx+16*�(�*dir/180)*fr
f bby=bby+16*�(�*dir/180)*fr
pX �ball=0�4:� open � �(bbx-ball(ball,0))<10 � �(bby-ball(ball,1))<10 � ball(ball,0)=0
z �:�drawmini
� �
� :
�s � Calculate ballbot's background echo reading (-balls), using several points to check out where net posts are.
� ݤback(x,y,freq)
� � freqa,dummy
�. freqa=�back2(x,y,freq,100,923):ftype$=ft$
� � ft$="U" � =freqa
�I dummy=�back2(x,y,freq,100,125):� ft$="N" � dummy<=freqa � ftype$="P"
�I dummy=�back2(x,y,freq,898,923):� ft$="N" � dummy<=freqa � ftype$="P"
� =freqa
� :
�' � Calculate reading from one point
� ݤback2(x,y,freq,min,max)
D ft$="U":� Set up general value of frequency type (UNIDENTIFIED)
0 � Calculate Angle of net as seen by Ballbot
 � freqa
$+ netlow=(�angle(640,max,x,y)-dir) � 360
.# � netlow<0 � netlow=netlow+360
8% � netlow>180 � netlow=netlow-360
B* nethi=(�angle(640,min,x,y)-dir) � 360
L  � nethi<0 � nethi=nethi+360
V" � nethi>180 � nethi=nethi-360
` :
j � Calculate reading
t 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):ft$="N"
� =freqa
� :
�2 � Calculate Ballbot's readings (MAIN ROUTINE)
� :
� ��sense
�* � Get background readings from FNback
� freq=�(250)+1500
�) freqa=�back(bbx,bby,freq):fa$=ftype$
�4 dir=dir-30:freqb=�back(bbx,bby,freq):fb$=ftype$
�4 dir=dir+60:freqc=�back(bbx,bby,freq):fc$=ftype$
�@ dir=dir-105:freqd=�back(bbx,bby,freq):dir=dir+75:fd$=ftype$
� :
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
2E a=�angle(ball(ball,0),ball(ball,1),bbx,bby)-dir:�a>180 � a=a-360
<, � �(a)<15 � freqa>d% � freqa=d%:fa$="B"
F3 � a>-46 � a<=-15 � freqb>d% � freqb=d%:fb$="B"
P1 � a>=15 � a<46 � freqc>d% � freqc=d%:fc$="B"
Z3 � a>-90 � a<=-46 � freqd>d% � freqd=d%:fd$="B"
d �
n :
x � Update user displays
� :
� � type$="2" � �
�; �0,0)�((�-start)/12000);":";(�((�-start)/200)�60);" "
�C �0,31)fd$,fb$,fa$,fc$,stage,�(searching),left,right,opencter;
�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<0 � ang=ang+360
� =ang � 360
 :
- � Computer Monitor of BallBot's progress
 ��compmon
r � idle � (ball(0,0)<>0 � ball(1,0)<>0 � ball(2,0)<>0 � ball(3,0)<>0 � ball(4,0)<>0) � st$="Fail" � st$="Pass"
"? � idle � �st$,�((�-start)/12000);":";(�((�-start)/200)�60)
,, � �>start+48000 � idle=�:�"Time","****"
6< �bbx>630�bbx<650�bby>100�bby<923�idle=�:�"Crash","****"
@k � idle � bbx=640:bby=950:dir=270:stage=0:�setupbb:start=�:�b=0�4:ball(b,0)=�(1280):ball(b,1)=�(1024):�
E� � idle � �"[";ball(0,0);",";ball(0,1);"] [";ball(1,0);",";ball(1,1);"] [";ball(2,0);",";ball(2,1);"] [";ball(3,0);",";ball(3,1);"] [";ball(4,0);",";ball(4,1);"]",;:idle=�
J �
T :
^* � BALLBOT ROBOTIC INTELLIGENCE MODULE
h :
r ݤ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
 � left � feed=feed+4
 � right � feed=feed+8
 � turbo � feed=feed+16
&  � opencter>0 � feed=feed+32
0
 =feed
: :
D( � Perform a sweep to find any balls
N ��hunt
X# � Watch out if too near to net
b� �((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=�:�
l
 reving=�
v :
�: � If Ball is out of reach in the "D" sector, reverse!
�� FDR=freqd*1.25:�freqd<150�fd$="B"�FDR<freqa �FDR<freqb �FDR<freqc �(fa$<>"B"�freqa>100)�(fb$<>"B"�freqb>100)�(fc$<>"B"�freqc>100)� turbo=�:reverse=�:fwd=�:right=�:farleft=-6*(freqd>40):�
� � farleft>0 �
�7  farleft=farleft-1:reverse=�:fwd=�:right=�:turbo=�
�3  � fa$="B" � (fd$<>"B" � fb$<>"B") � farleft=0
�  �
� �
� :
� � Rotate to face ball
�@ � (fb$="B" � freqb>150) � (fd$="B" � freqd>150) � tending=0
�& � fc$="B" � freqc>150 � tending=1
�) � opencter>0 � opencter=opencter-1:�
�f opencter=-5*(((freqa<20)�fa$="B")�((freqb<20)�fb$="B")�((freqc<20)�fc$="B")�((freqd<20)�fd$="B"))
�` � fa$="B" � left=(steer=-1):right=(steer=1):steer=0:searching=searching/2:turbo=freqa>100:�
�, � fb$="B" � fd$="B" � steer=-1:left=�:�
�" � fc$="B" � steer=1:right=�:�
0 � If no ball in sight, continue rotation...
" align=�:searching=searching+1
* � (tending � 1)<>0 � right=� � left=�
 * � searching=5 � tending=(tending � 1)
4$ � searching>150 � stage=stage+1
> �
H :
R< � Find edge of net and aim for it to move to other side
\ ��moveout
f# � Watch out if too near to net
p� � (freqa<30 � freqb<30 � freqc<30) � (reving � (freqa<250 � freqb<250 � freqc<250)) � reving=�:farleft=0:reverse=�:fwd=�:right=�:left=(freqa>230 � freqb>230 � freqc>230):�
z
 reving=�
�, � Align ballbot to face the net post...
�$ � fa$="N" � fa$="P" � right=�:�
�% � fb$<>"N" � fb$<>"P" � left=�:�
�- � fb$="P" � freqb<150 � right=�:near=1:�
� turbo=�
� �
� :
�G � Nearly there... Just need a little nudge in the right direction.
� ��donearstuff
� near=near+1
	 � near<8 � right=�:�
	 left=�
	; � near>16 � near=0:stage=stage+1:searching=0:tending=1
	$ �
	. :
	8= � Initialise BallBot variables at the beginning of a run
	B ��setupbb
	L? reving=�:left=�:right=�:fwd=�:reverse=�:searching=0:idle=�
	V2 near=�:farleft=0:opencter=0:tending=1:steer=0
	` �
	j :
	t ��releaseb
	~- � Got all the balls, now just dump them!
	�  near=near+1:reverse=�:fwd=�
	� � near>9 � idle=�:near=�
	� �
	�D �:�X=1�12:�"CHANNELVOICE 1 "+�X:�1,-10,52,100:�R=0�10000:�,:� �
	� :
	�B � Whizz-back to line up with D - what if whizz back into net?
	�9 � Reverse if BallBot knows that balls are behind it.
�
00000000  0d 00 0a 13 20 f4 20 42  61 6c 6c 42 6f 74 20 56  |.... . BallBot V|
00000010  33 2e 30 0d 00 14 37 20  f4 20 52 65 61 6c 2d 54  |3.0...7 . Real-T|
00000020  69 6d 65 20 56 65 72 73  69 6f 6e 20 77 69 74 68  |ime Version with|
00000030  20 43 6f 6e 74 69 6e 75  6f 75 73 20 54 65 73 74  | Continuous Test|
00000040  69 6e 67 20 4f 70 74 69  6f 6e 0d 00 1e 1c 20 f4  |ing Option.... .|
00000050  20 28 43 29 20 44 6f 6d  69 6e 69 63 20 46 6f 72  | (C) Dominic For|
00000060  64 20 31 39 39 37 0d 00  28 06 20 3a 0d 00 32 15  |d 1997..(. :..2.|
00000070  20 f4 20 57 65 6c 63 6f  6d 65 20 73 63 72 65 65  | . Welcome scree|
00000080  6e 0d 00 3c a2 20 eb 36  3a 40 25 3d 26 39 30 35  |n..<. .6:@%=&905|
00000090  3a f1 22 20 42 61 6c 6c  42 6f 74 20 41 72 74 69  |:." BallBot Arti|
000000a0  66 69 63 69 61 6c 20 49  6e 74 65 6c 6c 69 67 65  |ficial Intellige|
000000b0  6e 63 65 20 4d 6f 64 75  6c 65 22 27 22 53 69 6d  |nce Module"'"Sim|
000000c0  75 6c 61 74 69 6f 6e 20  54 65 73 74 65 72 20 56  |ulation Tester V|
000000d0  33 2e 30 20 52 65 61 6c  20 54 69 6d 65 20 56 65  |3.0 Real Time Ve|
000000e0  72 73 69 6f 6e 22 27 27  22 50 72 6f 67 72 61 6d  |rsion"''"Program|
000000f0  6d 65 64 20 61 6e 64 20  44 65 73 69 67 6e 65 64  |med and Designed|
00000100  20 62 79 20 44 6f 6d 69  6e 69 63 20 46 6f 72 64  | by Dominic Ford|
00000110  22 27 27 89 28 31 36 29  3b 22 28 43 29 20 31 39  |"''.(16);"(C) 19|
00000120  39 37 22 0d 00 46 55 20  f1 27 27 27 22 31 2e 20  |97"..FU .'''"1. |
00000130  52 65 61 6c 2d 54 69 6d  65 20 53 69 6d 75 6c 61  |Real-Time Simula|
00000140  74 69 6f 6e 22 27 27 22  32 2e 20 4c 6f 67 67 65  |tion"''"2. Logge|
00000150  64 20 43 6f 6e 74 69 6e  75 6f 75 73 20 52 75 6e  |d Continuous Run|
00000160  73 22 27 27 22 33 2e 20  44 6f 20 73 70 65 63 69  |s"''"3. Do speci|
00000170  66 69 63 20 72 75 6e 22  0d 00 50 32 20 f5 20 74  |fic run"..P2 . t|
00000180  79 70 65 24 3d be 3a fd  20 74 79 70 65 24 3d 22  |ype$=.:. type$="|
00000190  31 22 20 84 20 74 79 70  65 24 3d 22 32 22 20 84  |1" . type$="2" .|
000001a0  20 74 79 70 65 24 3d 22  33 22 0d 00 5a 06 20 3a  | type$="3"..Z. :|
000001b0  0d 00 64 16 20 f4 20 53  65 74 75 70 20 76 61 72  |..d. . Setup var|
000001c0  69 61 62 6c 65 73 0d 00  69 24 20 ee 20 85 20 ff  |iables..i$ . . .|
000001d0  22 43 4c 4f 53 45 22 3a  f6 3a f1 22 20 61 74 20  |"CLOSE":.:." at |
000001e0  6c 69 6e 65 20 22 3b 9e  3a e0 0d 00 6e 26 20 c8  |line ";.:...n& .|
000001f0  a1 20 31 2c 22 53 74 72  69 6e 67 4c 69 62 2d 53  |. 1,"StringLib-S|
00000200  6f 66 74 22 3a 2a 53 54  45 52 45 4f 20 31 20 30  |oft":*STEREO 1 0|
00000210  0d 00 78 29 20 c8 a1 20  32 2c 22 53 74 72 69 6e  |..x) .. 2,"Strin|
00000220  67 4c 69 62 2d 53 6f 66  74 22 3a 2a 53 54 45 52  |gLib-Soft":*STER|
00000230  45 4f 20 32 20 2d 31 32  37 0d 00 82 28 20 c8 a1  |EO 2 -127...( ..|
00000240  20 33 2c 22 53 74 72 69  6e 67 4c 69 62 2d 53 6f  | 3,"StringLib-So|
00000250  66 74 22 3a 2a 53 54 45  52 45 4f 20 33 20 31 32  |ft":*STEREO 3 12|
00000260  37 0d 00 8c 3a 20 63 75  72 72 65 6e 74 3d 30 3a  |7...: current=0:|
00000270  de 62 61 6c 6c 28 34 2c  31 29 3a 62 62 78 3d 36  |.ball(4,1):bbx=6|
00000280  34 30 3a 62 62 79 3d 39  35 30 3a 64 69 72 3d 32  |40:bby=950:dir=2|
00000290  37 30 3a f2 73 65 74 75  70 62 62 0d 00 96 25 20  |70:.setupbb...% |
000002a0  eb 31 35 3a e7 20 74 79  70 65 24 3d 22 31 22 20  |.15:. type$="1" |
000002b0  8c 20 c8 97 20 ee 3a f2  64 72 61 77 66 75 6c 6c  |. .. .:.drawfull|
000002c0  0d 00 9b 45 20 e7 20 74  79 70 65 24 3d 22 32 22  |...E . type$="2"|
000002d0  20 8c 20 73 74 61 72 74  3d 91 3a 73 74 61 67 65  | . start=.:stage|
000002e0  3d 30 3a 69 64 6c 65 3d  a3 3a e8 22 46 69 6c 65  |=0:idle=.:."File|
000002f0  6e 61 6d 65 22 3b 66 24  3a ff 22 53 50 4f 4f 4c  |name";f$:."SPOOL|
00000300  20 22 2b 66 24 0d 00 9d  67 20 e7 20 74 79 70 65  | "+f$...g . type|
00000310  24 3d 22 33 22 20 8c 20  f1 22 45 6e 74 65 72 20  |$="3" . ."Enter |
00000320  44 61 74 61 3a 22 27 3a  e3 62 3d 30 b8 34 3a f1  |Data:"':.b=0.4:.|
00000330  22 42 61 6c 6c 20 22 3b  62 2b 31 3b 3a e8 62 61  |"Ball ";b+1;:.ba|
00000340  6c 6c 28 62 2c 30 29 2c  62 61 6c 6c 28 62 2c 31  |ll(b,0),ball(b,1|
00000350  29 3a ed 3a 74 79 70 65  24 3d 22 31 22 3a c8 97  |):.:type$="1":..|
00000360  20 ee 3a f2 64 72 61 77  66 75 6c 6c 0d 00 a0 06  | .:.drawfull....|
00000370  20 3a 0d 00 aa 16 20 f4  20 53 74 61 72 74 20 6d  | :.... . Start m|
00000380  61 69 6e 20 6c 6f 6f 70  0d 00 b4 0a 20 f5 3a 54  |ain loop.... .:T|
00000390  3d 91 0d 00 be 23 20 e7  20 74 79 70 65 24 3d 22  |=....# . type$="|
000003a0  31 22 20 8c 20 f2 75 73  65 72 20 8b 20 f2 63 6f  |1" . .user . .co|
000003b0  6d 70 6d 6f 6e 0d 00 c8  11 20 e7 20 69 64 6c 65  |mpmon.... . idle|
000003c0  20 8c 20 fd 20 a3 0d 00  d2 0b 20 f2 73 65 6e 73  | . . ..... .sens|
000003d0  65 0d 00 dc 1f 20 6d 6f  76 3d a4 61 69 28 66 72  |e.... mov=.ai(fr|
000003e0  65 71 61 2c 66 72 65 71  62 2c 66 72 65 71 63 29  |eqa,freqb,freqc)|
000003f0  0d 00 e6 15 20 66 77 64  3d 28 6d 6f 76 20 80 20  |.... fwd=(mov . |
00000400  31 29 3c 3e 30 0d 00 f0  19 20 72 65 76 65 72 73  |1)<>0.... revers|
00000410  65 3d 28 6d 6f 76 20 80  20 32 29 3c 3e 30 0d 00  |e=(mov . 2)<>0..|
00000420  fa 16 20 6c 65 66 74 3d  28 6d 6f 76 20 80 20 34  |.. left=(mov . 4|
00000430  29 3c 3e 30 0d 01 04 17  20 72 69 67 68 74 3d 28  |)<>0.... right=(|
00000440  6d 6f 76 20 80 20 38 29  3c 3e 30 0d 01 0e 18 20  |mov . 8)<>0.... |
00000450  74 75 72 62 6f 3d 28 6d  6f 76 20 80 20 31 36 29  |turbo=(mov . 16)|
00000460  3c 3e 30 0d 01 18 17 20  6f 70 65 6e 3d 28 6d 6f  |<>0.... open=(mo|
00000470  76 20 80 20 33 32 29 3c  3e 30 0d 01 22 0c 20 f2  |v . 32)<>0..". .|
00000480  6d 6f 76 65 69 74 0d 01  2c 11 20 f5 20 fd 20 91  |moveit..,. . . .|
00000490  3e 28 54 2b 33 30 29 0d  01 36 08 20 fd 20 a3 0d  |>(T+30)..6. . ..|
000004a0  01 40 06 20 3a 0d 01 4a  18 20 f4 20 47 72 61 70  |.@. :..J. . Grap|
000004b0  68 69 63 20 69 6e 74 65  72 66 61 63 65 0d 01 54  |hic interface..T|
000004c0  0f 20 dd f2 64 72 61 77  66 75 6c 6c 0d 01 5e 17  |. ..drawfull..^.|
000004d0  20 f4 20 53 65 74 20 75  70 20 63 6f 6e 73 74 61  | . Set up consta|
000004e0  6e 74 73 0d 01 68 11 20  ea 73 78 2c 73 79 2c 77  |nts..h. .sx,sy,w|
000004f0  69 64 74 68 0d 01 72 17  20 73 78 3d 31 3a 73 79  |idth..r. sx=1:sy|
00000500  3d 32 3a 77 69 64 74 68  3d 31 30 0d 01 7c 1c 20  |=2:width=10..|. |
00000510  f4 20 44 72 61 77 20 67  72 65 65 6e 20 63 6f 75  |. Draw green cou|
00000520  72 74 20 61 72 65 61 0d  01 86 25 20 db 3a e6 30  |rt area...% .:.0|
00000530  2c 25 30 30 30 31 30 30  3a c8 93 20 c8 90 20 30  |,%000100:.. .. 0|
00000540  2c 30 2c 31 32 37 39 2c  31 30 32 33 0d 01 90 26  |,0,1279,1023...&|
00000550  20 f4 20 4d 61 72 6b 20  6f 75 74 20 77 68 69 74  | . Mark out whit|
00000560  65 20 6c 69 6e 65 73 20  6f 6e 74 6f 20 63 6f 75  |e lines onto cou|
00000570  72 74 0d 01 9a b2 20 e6  30 2c 25 31 31 31 31 31  |rt.... .0,%11111|
00000580  31 3a c8 93 20 c8 90 20  73 78 2f 28 32 33 2e 37  |1:.. .. sx/(23.7|
00000590  37 2b 32 2a 73 78 29 2a  31 32 38 30 2c 73 79 2f  |7+2*sx)*1280,sy/|
000005a0  28 31 30 2e 39 37 2b 32  2a 73 79 29 2a 31 30 32  |(10.97+2*sy)*102|
000005b0  34 2c 32 33 2e 37 37 2f  28 32 33 2e 37 37 2b 32  |4,23.77/(23.77+2|
000005c0  2a 73 78 29 2a 31 32 38  30 2c 77 69 64 74 68 3a  |*sx)*1280,width:|
000005d0  c8 93 20 c8 90 20 73 78  2f 28 32 33 2e 37 37 2b  |.. .. sx/(23.77+|
000005e0  32 2a 73 78 29 2a 31 32  38 30 2c 28 31 2e 33 37  |2*sx)*1280,(1.37|
000005f0  2b 73 79 29 2f 28 31 30  2e 39 37 2b 32 2a 73 79  |+sy)/(10.97+2*sy|
00000600  29 2a 31 30 32 34 2c 32  33 2e 37 37 2f 28 32 33  |)*1024,23.77/(23|
00000610  2e 37 37 2b 32 2a 73 78  29 2a 31 32 38 30 2c 77  |.77+2*sx)*1280,w|
00000620  69 64 74 68 0d 01 a4 ae  20 c8 93 20 c8 90 20 73  |idth.... .. .. s|
00000630  78 2f 28 32 33 2e 37 37  2b 32 2a 73 78 29 2a 31  |x/(23.77+2*sx)*1|
00000640  32 38 30 2c 28 39 2e 36  2b 73 79 29 2f 28 31 30  |280,(9.6+sy)/(10|
00000650  2e 39 37 2b 32 2a 73 79  29 2a 31 30 32 34 2c 32  |.97+2*sy)*1024,2|
00000660  33 2e 37 37 2f 28 32 33  2e 37 37 2b 32 2a 73 78  |3.77/(23.77+2*sx|
00000670  29 2a 31 32 38 30 2c 77  69 64 74 68 3a c8 93 20  |)*1280,width:.. |
00000680  c8 90 20 73 78 2f 28 32  33 2e 37 37 2b 32 2a 73  |.. sx/(23.77+2*s|
00000690  78 29 2a 31 32 38 30 2c  28 31 30 2e 39 37 2b 73  |x)*1280,(10.97+s|
000006a0  79 29 2f 28 31 30 2e 39  37 2b 32 2a 73 79 29 2a  |y)/(10.97+2*sy)*|
000006b0  31 30 32 34 2c 32 33 2e  37 37 2f 28 32 33 2e 37  |1024,23.77/(23.7|
000006c0  37 2b 32 2a 73 78 29 2a  31 32 38 30 2c 77 69 64  |7+2*sx)*1280,wid|
000006d0  74 68 0d 01 ae 5f 20 c8  93 20 c8 90 20 28 73 78  |th..._ .. .. (sx|
000006e0  2b 35 2e 34 37 29 2f 28  32 33 2e 37 37 2b 32 2a  |+5.47)/(23.77+2*|
000006f0  73 78 29 2a 31 32 38 30  2c 28 73 79 2b 35 2e 34  |sx)*1280,(sy+5.4|
00000700  39 29 2f 28 31 30 2e 39  37 2b 32 2a 73 79 29 2a  |9)/(10.97+2*sy)*|
00000710  31 30 32 34 2c 31 32 2e  38 2f 28 32 33 2e 37 37  |1024,12.8/(23.77|
00000720  2b 32 2a 73 78 29 2a 31  32 38 30 2c 77 69 64 74  |+2*sx)*1280,widt|
00000730  68 0d 01 b8 ae 20 c8 93  20 c8 90 20 73 78 2f 28  |h.... .. .. sx/(|
00000740  32 33 2e 37 37 2b 32 2a  73 78 29 2a 31 32 38 30  |23.77+2*sx)*1280|
00000750  2c 73 79 2f 28 31 30 2e  39 37 2b 32 2a 73 79 29  |,sy/(10.97+2*sy)|
00000760  2a 31 30 32 34 2c 77 69  64 74 68 2c 31 30 2e 39  |*1024,width,10.9|
00000770  37 2f 28 31 30 2e 39 37  2b 32 2a 73 79 29 2a 31  |7/(10.97+2*sy)*1|
00000780  30 32 34 3a c8 93 20 c8  90 20 28 73 78 2b 32 33  |024:.. .. (sx+23|
00000790  2e 37 37 29 2f 28 32 33  2e 37 37 2b 32 2a 73 78  |.77)/(23.77+2*sx|
000007a0  29 2a 31 32 38 30 2c 73  79 2f 28 31 30 2e 39 37  |)*1280,sy/(10.97|
000007b0  2b 32 2a 73 79 29 2a 31  30 32 34 2c 77 69 64 74  |+2*sy)*1024,widt|
000007c0  68 2c 31 30 2e 39 37 2f  28 31 30 2e 39 37 2b 32  |h,10.97/(10.97+2|
000007d0  2a 73 79 29 2a 31 30 32  34 2b 77 69 64 74 68 0d  |*sy)*1024+width.|
000007e0  01 c2 ba 20 c8 93 20 c8  90 20 28 73 78 2b 35 2e  |... .. .. (sx+5.|
000007f0  34 37 29 2f 28 32 33 2e  37 37 2b 32 2a 73 78 29  |47)/(23.77+2*sx)|
00000800  2a 31 32 38 30 2c 28 73  79 2b 31 2e 33 37 29 2f  |*1280,(sy+1.37)/|
00000810  28 31 30 2e 39 37 2b 32  2a 73 79 29 2a 31 30 32  |(10.97+2*sy)*102|
00000820  34 2c 77 69 64 74 68 2c  38 2e 32 33 2f 28 31 30  |4,width,8.23/(10|
00000830  2e 39 37 2b 32 2a 73 79  29 2a 31 30 32 34 3a c8  |.97+2*sy)*1024:.|
00000840  93 20 c8 90 20 28 73 78  2b 31 38 2e 33 29 2f 28  |. .. (sx+18.3)/(|
00000850  32 33 2e 37 37 2b 32 2a  73 78 29 2a 31 32 38 30  |23.77+2*sx)*1280|
00000860  2c 28 73 79 2b 31 2e 33  37 29 2f 28 31 30 2e 39  |,(sy+1.37)/(10.9|
00000870  37 2b 32 2a 73 79 29 2a  31 30 32 34 2c 77 69 64  |7+2*sy)*1024,wid|
00000880  74 68 2c 38 2e 32 33 2f  28 31 30 2e 39 37 2b 32  |th,8.23/(10.97+2|
00000890  2a 73 79 29 2a 31 30 32  34 0d 01 cc 06 20 3a 0d  |*sy)*1024.... :.|
000008a0  01 d6 0f 20 f4 20 44 72  61 77 20 6e 65 74 0d 01  |... . Draw net..|
000008b0  e0 89 20 e6 30 2c 30 3a  e3 6c 3d 31 30 30 b8 39  |.. .0,0:.l=100.9|
000008c0  32 34 88 31 30 3a ec 20  36 34 30 2c 6c 3a df 20  |24.10:. 640,l:. |
000008d0  36 38 30 2c 6c 2b 35 30  3a ed 3a e3 6c 3d 30 b8  |680,l+50:.:.l=0.|
000008e0  34 30 88 31 30 3a ec 20  36 34 30 2b 6c 2c 31 30  |40.10:. 640+l,10|
000008f0  30 2b 6c 3a df 36 34 30  2b 6c 2c 39 32 34 2b 6c  |0+l:.640+l,924+l|
00000900  3a ed 3a e3 6c 3d 30 b8  35 3a ec 36 33 37 2b 6c  |:.:.l=0.5:.637+l|
00000910  2c 31 30 30 3a df 36 37  37 2b 6c 2c 31 35 30 3a  |,100:.677+l,150:|
00000920  ec 36 33 37 2b 6c 2c 39  32 34 3a df 36 37 37 2b  |.637+l,924:.677+|
00000930  6c 2c 39 37 34 3a ed 0d  01 ea 22 20 e6 30 2c 25  |l,974:...." .0,%|
00000940  31 31 31 31 31 31 3a ec  20 36 38 32 2c 31 34 32  |111111:. 682,142|
00000950  3a df 36 38 32 2c 39 36  36 0d 01 f4 0e 20 f2 64  |:.682,966.... .d|
00000960  72 61 77 6d 69 6e 69 0d  01 fe 06 20 e1 0d 02 08  |rawmini.... ....|
00000970  06 20 3a 0d 02 12 1d 20  f4 20 44 72 61 77 20 62  |. :.... . Draw b|
00000980  61 6c 6c 62 6f 74 20 61  6e 64 20 62 61 6c 6c 73  |allbot and balls|
00000990  0d 02 1c 0f 20 dd f2 64  72 61 77 6d 69 6e 69 0d  |.... ..drawmini.|
000009a0  02 26 14 20 e7 20 74 79  70 65 24 3d 22 32 22 20  |.&. . type$="2" |
000009b0  8c 20 e1 0d 02 30 16 20  e6 33 2c 25 30 30 31 30  |. ...0. .3,%0010|
000009c0  31 31 3a e3 62 3d 30 b8  34 0d 02 3a 42 20 e7 20  |11:.b=0.4..:B . |
000009d0  62 61 6c 6c 28 62 2c 30  29 3c 3e 30 20 84 20 62  |ball(b,0)<>0 . b|
000009e0  61 6c 6c 28 62 2c 31 29  3c 3e 30 20 8c 20 c8 93  |all(b,1)<>0 . ..|
000009f0  20 c8 90 20 62 61 6c 6c  28 62 2c 30 29 2c 62 61  | .. ball(b,0),ba|
00000a00  6c 6c 28 62 2c 31 29 2c  35 2c 35 0d 02 44 06 20  |ll(b,1),5,5..D. |
00000a10  ed 0d 02 4e 21 20 e6 33  2c 25 30 30 30 31 31 31  |...N! .3,%000111|
00000a20  3a c8 93 20 c8 90 20 62  62 78 2c 62 62 79 2c 35  |:.. .. bbx,bby,5|
00000a30  2c 35 0d 02 58 06 20 e1  0d 02 62 06 20 3a 0d 02  |,5..X. ...b. :..|
00000a40  6c 2a 20 f4 20 55 73 65  72 20 69 6e 74 65 72 66  |l* . User interf|
00000a50  61 63 65 20 28 70 75 74  74 69 6e 67 20 62 61 6c  |ace (putting bal|
00000a60  6c 73 20 64 6f 77 6e 29  0d 02 76 0b 20 dd f2 75  |ls down)..v. ..u|
00000a70  73 65 72 0d 02 80 0d 20  c8 97 20 78 2c 79 2c 63  |ser.... .. x,y,c|
00000a80  0d 02 8a 0e 20 e7 20 63  3d 30 20 8c 20 e1 0d 02  |.... . c=0 . ...|
00000a90  94 61 20 e7 20 28 63 20  80 20 34 29 3c 3e 30 20  |.a . (c . 4)<>0 |
00000aa0  8c 20 f2 64 72 61 77 6d  69 6e 69 3a 62 61 6c 6c  |. .drawmini:ball|
00000ab0  28 63 75 72 72 65 6e 74  2c 30 29 3d 78 3a 62 61  |(current,0)=x:ba|
00000ac0  6c 6c 28 63 75 72 72 65  6e 74 2c 31 29 3d 79 3a  |ll(current,1)=y:|
00000ad0  63 75 72 72 65 6e 74 3d  28 63 75 72 72 65 6e 74  |current=(current|
00000ae0  2b 31 29 83 35 3a f2 64  72 61 77 6d 69 6e 69 0d  |+1).5:.drawmini.|
00000af0  02 9e 2a 20 e7 20 28 63  20 80 20 32 29 3c 3e 30  |..* . (c . 2)<>0|
00000b00  20 8c 20 69 64 6c 65 3d  a3 3a 73 74 61 67 65 3d  | . idle=.:stage=|
00000b10  30 3a 73 74 61 72 74 3d  91 0d 02 a8 06 20 f5 0d  |0:start=..... ..|
00000b20  02 b2 0d 20 c8 97 20 78  2c 79 2c 63 0d 02 bc 0a  |... .. x,y,c....|
00000b30  20 fd 20 63 3d 30 0d 02  c6 06 20 e1 0d 02 d0 06  | . c=0.... .....|
00000b40  20 3a 0d 02 da 27 20 f4  20 43 61 6c 63 75 6c 61  | :...' . Calcula|
00000b50  74 65 20 62 61 6c 6c 62  6f 74 27 73 20 6e 65 77  |te ballbot's new|
00000b60  20 70 6f 73 69 74 69 6f  6e 0d 02 e4 0d 20 dd f2  | position.... ..|
00000b70  6d 6f 76 65 69 74 0d 02  ee 41 20 e7 20 28 6c 65  |moveit...A . (le|
00000b80  66 74 20 80 20 66 77 64  29 20 84 20 28 72 69 67  |ft . fwd) . (rig|
00000b90  68 74 20 80 20 72 65 76  65 72 73 65 29 20 8c 20  |ht . reverse) . |
00000ba0  64 69 72 3d 64 69 72 2d  32 2e 35 2a 28 31 2d 33  |dir=dir-2.5*(1-3|
00000bb0  2a 74 75 72 62 6f 29 0d  02 f8 41 20 e7 20 28 72  |*turbo)...A . (r|
00000bc0  69 67 68 74 20 80 20 66  77 64 29 20 84 20 28 6c  |ight . fwd) . (l|
00000bd0  65 66 74 20 80 20 72 65  76 65 72 73 65 29 20 8c  |eft . reverse) .|
00000be0  20 64 69 72 3d 64 69 72  2b 32 2e 35 2a 28 31 2d  | dir=dir+2.5*(1-|
00000bf0  33 2a 74 75 72 62 6f 29  0d 03 02 06 20 3a 0d 03  |3*turbo).... :..|
00000c00  0c 29 20 f4 20 47 65 74  20 64 69 72 65 63 74 69  |.) . Get directi|
00000c10  6f 6e 20 69 6e 20 72 61  6e 67 65 20 30 3c 74 68  |on in range 0<th|
00000c20  65 74 61 3c 33 36 30 0d  03 16 1c 20 f5 20 e7 20  |eta<360.... . . |
00000c30  64 69 72 3c 30 20 8c 20  64 69 72 3d 64 69 72 2b  |dir<0 . dir=dir+|
00000c40  33 36 30 0d 03 20 1d 20  e7 20 64 69 72 3e 3d 33  |360.. . . dir>=3|
00000c50  36 30 20 8c 20 64 69 72  3d 64 69 72 2d 33 36 30  |60 . dir=dir-360|
00000c60  0d 03 2a 17 20 fd 20 64  69 72 3e 3d 30 20 80 20  |..*. . dir>=0 . |
00000c70  64 69 72 3c 33 36 30 0d  03 34 06 20 3a 0d 03 3e  |dir<360..4. :..>|
00000c80  1c 20 66 72 3d 30 3a e7  20 66 77 64 20 8c 20 66  |. fr=0:. fwd . f|
00000c90  72 3d 66 72 2b 30 2e 32  35 0d 03 48 1b 20 e7 20  |r=fr+0.25..H. . |
00000ca0  72 65 76 65 72 73 65 20  8c 20 66 72 3d 66 72 2d  |reverse . fr=fr-|
00000cb0  30 2e 32 35 0d 03 52 16  20 e7 20 74 75 72 62 6f  |0.25..R. . turbo|
00000cc0  20 8c 20 66 72 3d 66 72  2a 34 0d 03 5c 29 20 f2  | . fr=fr*4..\) .|
00000cd0  64 72 61 77 6d 69 6e 69  3a 62 62 78 3d 62 62 78  |drawmini:bbx=bbx|
00000ce0  2b 31 36 2a b5 28 af 2a  64 69 72 2f 31 38 30 29  |+16*.(.*dir/180)|
00000cf0  2a 66 72 0d 03 66 1f 20  62 62 79 3d 62 62 79 2b  |*fr..f. bby=bby+|
00000d00  31 36 2a 9b 28 af 2a 64  69 72 2f 31 38 30 29 2a  |16*.(.*dir/180)*|
00000d10  66 72 0d 03 70 58 20 e3  62 61 6c 6c 3d 30 b8 34  |fr..pX .ball=0.4|
00000d20  3a e7 20 6f 70 65 6e 20  80 20 94 28 62 62 78 2d  |:. open . .(bbx-|
00000d30  62 61 6c 6c 28 62 61 6c  6c 2c 30 29 29 3c 31 30  |ball(ball,0))<10|
00000d40  20 80 20 94 28 62 62 79  2d 62 61 6c 6c 28 62 61  | . .(bby-ball(ba|
00000d50  6c 6c 2c 31 29 29 3c 31  30 20 8c 20 62 61 6c 6c  |ll,1))<10 . ball|
00000d60  28 62 61 6c 6c 2c 30 29  3d 30 0d 03 7a 10 20 ed  |(ball,0)=0..z. .|
00000d70  3a f2 64 72 61 77 6d 69  6e 69 0d 03 84 06 20 e1  |:.drawmini.... .|
00000d80  0d 03 8e 06 20 3a 0d 03  98 73 20 f4 20 43 61 6c  |.... :...s . Cal|
00000d90  63 75 6c 61 74 65 20 62  61 6c 6c 62 6f 74 27 73  |culate ballbot's|
00000da0  20 62 61 63 6b 67 72 6f  75 6e 64 20 65 63 68 6f  | background echo|
00000db0  20 72 65 61 64 69 6e 67  20 28 2d 62 61 6c 6c 73  | reading (-balls|
00000dc0  29 2c 20 75 73 69 6e 67  20 73 65 76 65 72 61 6c  |), using several|
00000dd0  20 70 6f 69 6e 74 73 20  74 6f 20 63 68 65 63 6b  | points to check|
00000de0  20 6f 75 74 20 77 68 65  72 65 20 6e 65 74 20 70  | out where net p|
00000df0  6f 73 74 73 20 61 72 65  2e 0d 03 a2 15 20 dd a4  |osts are..... ..|
00000e00  62 61 63 6b 28 78 2c 79  2c 66 72 65 71 29 0d 03  |back(x,y,freq)..|
00000e10  ac 12 20 ea 20 66 72 65  71 61 2c 64 75 6d 6d 79  |.. . freqa,dummy|
00000e20  0d 03 b6 2e 20 66 72 65  71 61 3d a4 62 61 63 6b  |.... freqa=.back|
00000e30  32 28 78 2c 79 2c 66 72  65 71 2c 31 30 30 2c 39  |2(x,y,freq,100,9|
00000e40  32 33 29 3a 66 74 79 70  65 24 3d 66 74 24 0d 03  |23):ftype$=ft$..|
00000e50  c0 17 20 e7 20 66 74 24  3d 22 55 22 20 8c 20 3d  |.. . ft$="U" . =|
00000e60  66 72 65 71 61 0d 03 ca  49 20 64 75 6d 6d 79 3d  |freqa...I dummy=|
00000e70  a4 62 61 63 6b 32 28 78  2c 79 2c 66 72 65 71 2c  |.back2(x,y,freq,|
00000e80  31 30 30 2c 31 32 35 29  3a e7 20 66 74 24 3d 22  |100,125):. ft$="|
00000e90  4e 22 20 80 20 64 75 6d  6d 79 3c 3d 66 72 65 71  |N" . dummy<=freq|
00000ea0  61 20 8c 20 66 74 79 70  65 24 3d 22 50 22 0d 03  |a . ftype$="P"..|
00000eb0  d4 49 20 64 75 6d 6d 79  3d a4 62 61 63 6b 32 28  |.I dummy=.back2(|
00000ec0  78 2c 79 2c 66 72 65 71  2c 38 39 38 2c 39 32 33  |x,y,freq,898,923|
00000ed0  29 3a e7 20 66 74 24 3d  22 4e 22 20 80 20 64 75  |):. ft$="N" . du|
00000ee0  6d 6d 79 3c 3d 66 72 65  71 61 20 8c 20 66 74 79  |mmy<=freqa . fty|
00000ef0  70 65 24 3d 22 50 22 0d  03 de 0b 20 3d 66 72 65  |pe$="P".... =fre|
00000f00  71 61 0d 03 e8 06 20 3a  0d 03 f2 27 20 f4 20 43  |qa.... :...' . C|
00000f10  61 6c 63 75 6c 61 74 65  20 72 65 61 64 69 6e 67  |alculate reading|
00000f20  20 66 72 6f 6d 20 6f 6e  65 20 70 6f 69 6e 74 0d  | from one point.|
00000f30  03 fc 1e 20 dd a4 62 61  63 6b 32 28 78 2c 79 2c  |... ..back2(x,y,|
00000f40  66 72 65 71 2c 6d 69 6e  2c 6d 61 78 29 0d 04 06  |freq,min,max)...|
00000f50  44 20 66 74 24 3d 22 55  22 3a f4 20 53 65 74 20  |D ft$="U":. Set |
00000f60  75 70 20 67 65 6e 65 72  61 6c 20 76 61 6c 75 65  |up general value|
00000f70  20 6f 66 20 66 72 65 71  75 65 6e 63 79 20 74 79  | of frequency ty|
00000f80  70 65 20 28 55 4e 49 44  45 4e 54 49 46 49 45 44  |pe (UNIDENTIFIED|
00000f90  29 0d 04 10 30 20 f4 20  43 61 6c 63 75 6c 61 74  |)...0 . Calculat|
00000fa0  65 20 41 6e 67 6c 65 20  6f 66 20 6e 65 74 20 61  |e Angle of net a|
00000fb0  73 20 73 65 65 6e 20 62  79 20 42 61 6c 6c 62 6f  |s seen by Ballbo|
00000fc0  74 0d 04 1a 0c 20 ea 20  66 72 65 71 61 0d 04 24  |t.... . freqa..$|
00000fd0  2b 20 6e 65 74 6c 6f 77  3d 28 a4 61 6e 67 6c 65  |+ netlow=(.angle|
00000fe0  28 36 34 30 2c 6d 61 78  2c 78 2c 79 29 2d 64 69  |(640,max,x,y)-di|
00000ff0  72 29 20 83 20 33 36 30  0d 04 2e 23 20 e7 20 6e  |r) . 360...# . n|
00001000  65 74 6c 6f 77 3c 30 20  8c 20 6e 65 74 6c 6f 77  |etlow<0 . netlow|
00001010  3d 6e 65 74 6c 6f 77 2b  33 36 30 0d 04 38 25 20  |=netlow+360..8% |
00001020  e7 20 6e 65 74 6c 6f 77  3e 31 38 30 20 8c 20 6e  |. netlow>180 . n|
00001030  65 74 6c 6f 77 3d 6e 65  74 6c 6f 77 2d 33 36 30  |etlow=netlow-360|
00001040  0d 04 42 2a 20 6e 65 74  68 69 3d 28 a4 61 6e 67  |..B* nethi=(.ang|
00001050  6c 65 28 36 34 30 2c 6d  69 6e 2c 78 2c 79 29 2d  |le(640,min,x,y)-|
00001060  64 69 72 29 20 83 20 33  36 30 0d 04 4c 20 20 e7  |dir) . 360..L  .|
00001070  20 6e 65 74 68 69 3c 30  20 8c 20 6e 65 74 68 69  | nethi<0 . nethi|
00001080  3d 6e 65 74 68 69 2b 33  36 30 0d 04 56 22 20 e7  |=nethi+360..V" .|
00001090  20 6e 65 74 68 69 3e 31  38 30 20 8c 20 6e 65 74  | nethi>180 . net|
000010a0  68 69 3d 6e 65 74 68 69  2d 33 36 30 0d 04 60 06  |hi=nethi-360..`.|
000010b0  20 3a 0d 04 6a 18 20 f4  20 43 61 6c 63 75 6c 61  | :..j. . Calcula|
000010c0  74 65 20 72 65 61 64 69  6e 67 0d 04 74 16 20 66  |te reading..t. f|
000010d0  72 65 71 61 3d 66 72 65  71 2b b3 28 36 29 2d 33  |reqa=freq+.(6)-3|
000010e0  0d 04 7e 8b 20 e7 20 94  28 b5 28 af 2a 64 69 72  |..~. . .(.(.*dir|
000010f0  2f 31 38 30 29 29 3e 30  2e 30 31 20 8c 20 e7 20  |/180))>0.01 . . |
00001100  28 28 6e 65 74 6c 6f 77  3c 30 20 80 20 6e 65 74  |((netlow<0 . net|
00001110  68 69 3e 30 29 20 84 20  28 6e 65 74 68 69 3c 30  |hi>0) . (nethi<0|
00001120  20 80 20 6e 65 74 6c 6f  77 3e 30 29 29 20 80 20  | . netlow>0)) . |
00001130  28 36 34 30 2d 78 29 2f  b5 28 af 2a 64 69 72 2f  |(640-x)/.(.*dir/|
00001140  31 38 30 29 3e 30 20 8c  20 66 72 65 71 61 3d 28  |180)>0 . freqa=(|
00001150  36 34 30 2d 78 29 2f b5  28 af 2a 64 69 72 2f 31  |640-x)/.(.*dir/1|
00001160  38 30 29 3a 66 74 24 3d  22 4e 22 0d 04 88 0b 20  |80):ft$="N".... |
00001170  3d 66 72 65 71 61 0d 04  92 06 20 3a 0d 04 9c 32  |=freqa.... :...2|
00001180  20 f4 20 43 61 6c 63 75  6c 61 74 65 20 42 61 6c  | . Calculate Bal|
00001190  6c 62 6f 74 27 73 20 72  65 61 64 69 6e 67 73 20  |lbot's readings |
000011a0  28 4d 41 49 4e 20 52 4f  55 54 49 4e 45 29 0d 04  |(MAIN ROUTINE)..|
000011b0  a6 06 20 3a 0d 04 b0 0c  20 dd f2 73 65 6e 73 65  |.. :.... ..sense|
000011c0  0d 04 ba 2a 20 f4 20 47  65 74 20 62 61 63 6b 67  |...* . Get backg|
000011d0  72 6f 75 6e 64 20 72 65  61 64 69 6e 67 73 20 66  |round readings f|
000011e0  72 6f 6d 20 46 4e 62 61  63 6b 0d 04 c4 15 20 66  |rom FNback.... f|
000011f0  72 65 71 3d b3 28 32 35  30 29 2b 31 35 30 30 0d  |req=.(250)+1500.|
00001200  04 ce 29 20 66 72 65 71  61 3d a4 62 61 63 6b 28  |..) freqa=.back(|
00001210  62 62 78 2c 62 62 79 2c  66 72 65 71 29 3a 66 61  |bbx,bby,freq):fa|
00001220  24 3d 66 74 79 70 65 24  0d 04 d8 34 20 64 69 72  |$=ftype$...4 dir|
00001230  3d 64 69 72 2d 33 30 3a  66 72 65 71 62 3d a4 62  |=dir-30:freqb=.b|
00001240  61 63 6b 28 62 62 78 2c  62 62 79 2c 66 72 65 71  |ack(bbx,bby,freq|
00001250  29 3a 66 62 24 3d 66 74  79 70 65 24 0d 04 e2 34  |):fb$=ftype$...4|
00001260  20 64 69 72 3d 64 69 72  2b 36 30 3a 66 72 65 71  | dir=dir+60:freq|
00001270  63 3d a4 62 61 63 6b 28  62 62 78 2c 62 62 79 2c  |c=.back(bbx,bby,|
00001280  66 72 65 71 29 3a 66 63  24 3d 66 74 79 70 65 24  |freq):fc$=ftype$|
00001290  0d 04 ec 40 20 64 69 72  3d 64 69 72 2d 31 30 35  |...@ dir=dir-105|
000012a0  3a 66 72 65 71 64 3d a4  62 61 63 6b 28 62 62 78  |:freqd=.back(bbx|
000012b0  2c 62 62 79 2c 66 72 65  71 29 3a 64 69 72 3d 64  |,bby,freq):dir=d|
000012c0  69 72 2b 37 35 3a 66 64  24 3d 66 74 79 70 65 24  |ir+75:fd$=ftype$|
000012d0  0d 04 f6 06 20 3a 0d 05  00 44 20 f4 20 41 64 64  |.... :...D . Add|
000012e0  20 61 6e 79 20 72 65 6c  65 76 61 6e 74 20 62 61  | any relevant ba|
000012f0  6c 6c 73 20 74 6f 20 72  65 61 64 69 6e 67 73 20  |lls to readings |
00001300  28 75 73 69 6e 67 20 68  61 69 72 79 20 74 72 69  |(using hairy tri|
00001310  67 6f 6e 6f 6d 65 74 72  79 29 0d 05 0a 06 20 3a  |gonometry).... :|
00001320  0d 05 14 0e 20 e3 62 61  6c 6c 3d 30 b8 34 0d 05  |.... .ball=0.4..|
00001330  1e 34 20 64 25 3d b6 28  28 62 61 6c 6c 28 62 61  |.4 d%=.((ball(ba|
00001340  6c 6c 2c 30 29 2d 62 62  78 29 5e 32 2b 28 62 61  |ll,0)-bbx)^2+(ba|
00001350  6c 6c 28 62 61 6c 6c 2c  31 29 2d 62 62 79 29 5e  |ll(ball,1)-bby)^|
00001360  32 29 0d 05 28 1f 20 e7  20 62 61 6c 6c 28 62 61  |2)..(. . ball(ba|
00001370  6c 6c 2c 30 29 3d 30 20  8c 20 64 25 3d 39 39 39  |ll,0)=0 . d%=999|
00001380  39 0d 05 32 45 20 61 3d  a4 61 6e 67 6c 65 28 62  |9..2E a=.angle(b|
00001390  61 6c 6c 28 62 61 6c 6c  2c 30 29 2c 62 61 6c 6c  |all(ball,0),ball|
000013a0  28 62 61 6c 6c 2c 31 29  2c 62 62 78 2c 62 62 79  |(ball,1),bbx,bby|
000013b0  29 2d 64 69 72 3a e7 61  3e 31 38 30 20 8c 20 61  |)-dir:.a>180 . a|
000013c0  3d 61 2d 33 36 30 0d 05  3c 2c 20 e7 20 94 28 61  |=a-360..<, . .(a|
000013d0  29 3c 31 35 20 80 20 66  72 65 71 61 3e 64 25 20  |)<15 . freqa>d% |
000013e0  8c 20 66 72 65 71 61 3d  64 25 3a 66 61 24 3d 22  |. freqa=d%:fa$="|
000013f0  42 22 0d 05 46 33 20 e7  20 61 3e 2d 34 36 20 80  |B"..F3 . a>-46 .|
00001400  20 61 3c 3d 2d 31 35 20  80 20 66 72 65 71 62 3e  | a<=-15 . freqb>|
00001410  64 25 20 8c 20 66 72 65  71 62 3d 64 25 3a 66 62  |d% . freqb=d%:fb|
00001420  24 3d 22 42 22 0d 05 50  31 20 e7 20 61 3e 3d 31  |$="B"..P1 . a>=1|
00001430  35 20 80 20 61 3c 34 36  20 80 20 66 72 65 71 63  |5 . a<46 . freqc|
00001440  3e 64 25 20 8c 20 66 72  65 71 63 3d 64 25 3a 66  |>d% . freqc=d%:f|
00001450  63 24 3d 22 42 22 0d 05  5a 33 20 e7 20 61 3e 2d  |c$="B"..Z3 . a>-|
00001460  39 30 20 80 20 61 3c 3d  2d 34 36 20 80 20 66 72  |90 . a<=-46 . fr|
00001470  65 71 64 3e 64 25 20 8c  20 66 72 65 71 64 3d 64  |eqd>d% . freqd=d|
00001480  25 3a 66 64 24 3d 22 42  22 0d 05 64 06 20 ed 0d  |%:fd$="B"..d. ..|
00001490  05 6e 06 20 3a 0d 05 78  1b 20 f4 20 55 70 64 61  |.n. :..x. . Upda|
000014a0  74 65 20 75 73 65 72 20  64 69 73 70 6c 61 79 73  |te user displays|
000014b0  0d 05 82 06 20 3a 0d 05  8c 14 20 e7 20 74 79 70  |.... :.... . typ|
000014c0  65 24 3d 22 32 22 20 8c  20 e1 0d 05 96 3b 20 f1  |e$="2" . ....; .|
000014d0  8a 30 2c 30 29 a8 28 28  91 2d 73 74 61 72 74 29  |.0,0).((.-start)|
000014e0  2f 31 32 30 30 30 29 3b  22 3a 22 3b 28 a8 28 28  |/12000);":";(.((|
000014f0  91 2d 73 74 61 72 74 29  2f 32 30 30 29 83 36 30  |.-start)/200).60|
00001500  29 3b 22 20 22 0d 05 a0  43 20 f1 8a 30 2c 33 31  |);" "...C ..0,31|
00001510  29 66 64 24 2c 66 62 24  2c 66 61 24 2c 66 63 24  |)fd$,fb$,fa$,fc$|
00001520  2c 73 74 61 67 65 2c a8  28 73 65 61 72 63 68 69  |,stage,.(searchi|
00001530  6e 67 29 2c 6c 65 66 74  2c 72 69 67 68 74 2c 6f  |ng),left,right,o|
00001540  70 65 6e 63 74 65 72 3b  0d 05 aa 37 20 d4 20 31  |pencter;...7 . 1|
00001550  2c 2d 31 2c 66 72 65 71  61 2f 34 2c 35 3a d4 20  |,-1,freqa/4,5:. |
00001560  32 2c 2d 31 2c 66 72 65  71 62 2f 34 2c 35 3a d4  |2,-1,freqb/4,5:.|
00001570  20 33 2c 2d 31 2c 66 72  65 71 63 2f 34 2c 35 0d  | 3,-1,freqc/4,5.|
00001580  05 b4 06 20 e1 0d 05 be  05 3a 0d 05 c8 24 20 f4  |... .....:...$ .|
00001590  20 43 61 6c 63 75 6c 61  74 65 20 62 65 61 72 69  | Calculate beari|
000015a0  6e 67 20 6f 66 20 42 20  66 72 6f 6d 20 41 0d 05  |ng of B from A..|
000015b0  d2 19 20 dd a4 61 6e 67  6c 65 28 78 31 2c 79 31  |.. ..angle(x1,y1|
000015c0  2c 78 32 2c 79 32 29 0d  05 dc 34 20 e7 20 79 32  |,x2,y2)...4 . y2|
000015d0  3d 79 31 20 8c 20 61 6e  67 3d 39 30 20 8b 20 61  |=y1 . ang=90 . a|
000015e0  6e 67 3d 31 38 30 2a 99  28 28 78 32 2d 78 31 29  |ng=180*.((x2-x1)|
000015f0  2f 28 79 32 2d 79 31 29  29 2f af 0d 05 e6 1c 20  |/(y2-y1))/..... |
00001600  e7 20 28 79 32 3e 79 31  29 20 8c 20 61 6e 67 3d  |. (y2>y1) . ang=|
00001610  61 6e 67 2b 31 38 30 0d  05 f0 1a 20 e7 20 61 6e  |ang+180.... . an|
00001620  67 3c 30 20 8c 20 61 6e  67 3d 61 6e 67 2b 33 36  |g<0 . ang=ang+36|
00001630  30 0d 05 fa 0f 20 3d 61  6e 67 20 83 20 33 36 30  |0.... =ang . 360|
00001640  0d 06 04 06 20 3a 0d 06  0e 2d 20 f4 20 43 6f 6d  |.... :...- . Com|
00001650  70 75 74 65 72 20 4d 6f  6e 69 74 6f 72 20 6f 66  |puter Monitor of|
00001660  20 42 61 6c 6c 42 6f 74  27 73 20 70 72 6f 67 72  | BallBot's progr|
00001670  65 73 73 0d 06 18 0e 20  dd f2 63 6f 6d 70 6d 6f  |ess.... ..compmo|
00001680  6e 0d 06 1d 72 20 e7 20  69 64 6c 65 20 80 20 28  |n...r . idle . (|
00001690  62 61 6c 6c 28 30 2c 30  29 3c 3e 30 20 84 20 62  |ball(0,0)<>0 . b|
000016a0  61 6c 6c 28 31 2c 30 29  3c 3e 30 20 84 20 62 61  |all(1,0)<>0 . ba|
000016b0  6c 6c 28 32 2c 30 29 3c  3e 30 20 84 20 62 61 6c  |ll(2,0)<>0 . bal|
000016c0  6c 28 33 2c 30 29 3c 3e  30 20 84 20 62 61 6c 6c  |l(3,0)<>0 . ball|
000016d0  28 34 2c 30 29 3c 3e 30  29 20 8c 20 73 74 24 3d  |(4,0)<>0) . st$=|
000016e0  22 46 61 69 6c 22 20 8b  20 73 74 24 3d 22 50 61  |"Fail" . st$="Pa|
000016f0  73 73 22 0d 06 22 3f 20  e7 20 69 64 6c 65 20 8c  |ss".."? . idle .|
00001700  20 f1 73 74 24 2c a8 28  28 91 2d 73 74 61 72 74  | .st$,.((.-start|
00001710  29 2f 31 32 30 30 30 29  3b 22 3a 22 3b 28 a8 28  |)/12000);":";(.(|
00001720  28 91 2d 73 74 61 72 74  29 2f 32 30 30 29 83 36  |(.-start)/200).6|
00001730  30 29 0d 06 2c 2c 20 e7  20 91 3e 73 74 61 72 74  |0)..,, . .>start|
00001740  2b 34 38 30 30 30 20 8c  20 69 64 6c 65 3d b9 3a  |+48000 . idle=.:|
00001750  f1 22 54 69 6d 65 22 2c  22 2a 2a 2a 2a 22 0d 06  |."Time","****"..|
00001760  36 3c 20 e7 62 62 78 3e  36 33 30 80 62 62 78 3c  |6< .bbx>630.bbx<|
00001770  36 35 30 80 62 62 79 3e  31 30 30 80 62 62 79 3c  |650.bby>100.bby<|
00001780  39 32 33 8c 69 64 6c 65  3d b9 3a f1 22 43 72 61  |923.idle=.:."Cra|
00001790  73 68 22 2c 22 2a 2a 2a  2a 22 0d 06 40 6b 20 e7  |sh","****"..@k .|
000017a0  20 69 64 6c 65 20 8c 20  62 62 78 3d 36 34 30 3a  | idle . bbx=640:|
000017b0  62 62 79 3d 39 35 30 3a  64 69 72 3d 32 37 30 3a  |bby=950:dir=270:|
000017c0  73 74 61 67 65 3d 30 3a  f2 73 65 74 75 70 62 62  |stage=0:.setupbb|
000017d0  3a 73 74 61 72 74 3d 91  3a e3 62 3d 30 b8 34 3a  |:start=.:.b=0.4:|
000017e0  62 61 6c 6c 28 62 2c 30  29 3d b3 28 31 32 38 30  |ball(b,0)=.(1280|
000017f0  29 3a 62 61 6c 6c 28 62  2c 31 29 3d b3 28 31 30  |):ball(b,1)=.(10|
00001800  32 34 29 3a ed 0d 06 45  af 20 e7 20 69 64 6c 65  |24):...E. . idle|
00001810  20 8c 20 f1 22 5b 22 3b  62 61 6c 6c 28 30 2c 30  | . ."[";ball(0,0|
00001820  29 3b 22 2c 22 3b 62 61  6c 6c 28 30 2c 31 29 3b  |);",";ball(0,1);|
00001830  22 5d 20 5b 22 3b 62 61  6c 6c 28 31 2c 30 29 3b  |"] [";ball(1,0);|
00001840  22 2c 22 3b 62 61 6c 6c  28 31 2c 31 29 3b 22 5d  |",";ball(1,1);"]|
00001850  20 5b 22 3b 62 61 6c 6c  28 32 2c 30 29 3b 22 2c  | [";ball(2,0);",|
00001860  22 3b 62 61 6c 6c 28 32  2c 31 29 3b 22 5d 20 5b  |";ball(2,1);"] [|
00001870  22 3b 62 61 6c 6c 28 33  2c 30 29 3b 22 2c 22 3b  |";ball(3,0);",";|
00001880  62 61 6c 6c 28 33 2c 31  29 3b 22 5d 20 5b 22 3b  |ball(3,1);"] [";|
00001890  62 61 6c 6c 28 34 2c 30  29 3b 22 2c 22 3b 62 61  |ball(4,0);",";ba|
000018a0  6c 6c 28 34 2c 31 29 3b  22 5d 22 2c 3b 3a 69 64  |ll(4,1);"]",;:id|
000018b0  6c 65 3d a3 0d 06 4a 06  20 e1 0d 06 54 06 20 3a  |le=...J. ...T. :|
000018c0  0d 06 5e 2a 20 f4 20 42  41 4c 4c 42 4f 54 20 52  |..^* . BALLBOT R|
000018d0  4f 42 4f 54 49 43 20 49  4e 54 45 4c 4c 49 47 45  |OBOTIC INTELLIGE|
000018e0  4e 43 45 20 4d 4f 44 55  4c 45 0d 06 68 06 20 3a  |NCE MODULE..h. :|
000018f0  0d 06 72 1c 20 dd a4 61  69 28 66 72 65 71 61 2c  |..r. ..ai(freqa,|
00001900  66 72 65 71 62 2c 66 72  65 71 63 29 0d 06 7c 39  |freqb,freqc)..|9|
00001910  20 f4 20 41 72 74 69 66  69 63 69 61 6c 20 69 6e  | . Artificial in|
00001920  74 65 6c 6c 69 67 65 6e  63 65 20 72 6f 75 74 69  |telligence routi|
00001930  6e 65 73 20 28 69 65 2e  20 57 68 61 74 20 4e 65  |nes (ie. What Ne|
00001940  78 74 3f 3f 29 0d 06 86  22 20 ea 66 77 64 2c 72  |xt??)..." .fwd,r|
00001950  65 76 65 72 73 65 2c 6c  65 66 74 2c 72 69 67 68  |everse,left,righ|
00001960  74 2c 74 75 72 62 6f 0d  06 90 2b 20 66 77 64 3d  |t,turbo...+ fwd=|
00001970  b9 3a 72 65 76 65 72 73  65 3d a3 3a 6c 65 66 74  |.:reverse=.:left|
00001980  3d a3 3a 72 69 67 68 74  3d a3 3a 74 75 72 62 6f  |=.:right=.:turbo|
00001990  3d a3 0d 06 9a 06 20 3a  0d 06 a4 40 20 f4 20 57  |=..... :...@ . W|
000019a0  68 61 74 20 73 74 61 67  65 20 61 72 65 20 77 65  |hat stage are we|
000019b0  20 69 6e 3f 20 48 75 6e  74 20 66 6f 72 20 62 61  | in? Hunt for ba|
000019c0  6c 6c 73 20 6f 72 20 6d  6f 76 65 20 74 6f 20 6e  |lls or move to n|
000019d0  65 77 20 61 72 65 61 3f  0d 06 ae 27 20 e7 20 6e  |ew area?...' . n|
000019e0  65 61 72 3c 3e 30 20 80  20 73 74 61 67 65 3c 38  |ear<>0 . stage<8|
000019f0  20 8c 20 f2 64 6f 6e 65  61 72 73 74 75 66 66 0d  | . .donearstuff.|
00001a00  06 b8 2b 20 e7 20 6e 65  61 72 3d 30 20 80 20 28  |..+ . near=0 . (|
00001a10  73 74 61 67 65 3d 30 20  84 20 73 74 61 67 65 3d  |stage=0 . stage=|
00001a20  32 29 20 8c 20 f2 68 75  6e 74 0d 06 c2 2e 20 e7  |2) . .hunt.... .|
00001a30  20 6e 65 61 72 3d 30 20  80 20 28 73 74 61 67 65  | near=0 . (stage|
00001a40  3d 31 20 84 20 73 74 61  67 65 3d 33 29 20 8c 20  |=1 . stage=3) . |
00001a50  f2 6d 6f 76 65 6f 75 74  0d 06 cc 1a 20 e7 20 73  |.moveout.... . s|
00001a60  74 61 67 65 3d 34 20 8c  20 f2 72 65 6c 65 61 73  |tage=4 . .releas|
00001a70  65 62 0d 06 d6 06 20 3a  0d 06 e0 32 20 f4 20 50  |eb.... :...2 . P|
00001a80  72 65 70 61 72 65 20 6f  75 74 70 75 74 20 69 6e  |repare output in|
00001a90  74 6f 20 62 69 6e 61 72  79 20 66 6f 72 20 74 72  |to binary for tr|
00001aa0  61 6e 73 6d 69 73 73 69  6f 6e 0d 06 ea 1f 20 66  |ansmission.... f|
00001ab0  65 65 64 3d 30 3a e7 20  66 77 64 20 8c 20 66 65  |eed=0:. fwd . fe|
00001ac0  65 64 3d 66 65 65 64 2b  31 0d 06 f4 17 20 e7 20  |ed=feed+1.... . |
00001ad0  72 65 76 69 6e 67 20 8c  20 74 75 72 62 6f 3d b9  |reving . turbo=.|
00001ae0  0d 06 fe 1c 20 e7 20 72  65 76 65 72 73 65 20 8c  |.... . reverse .|
00001af0  20 66 65 65 64 3d 66 65  65 64 2b 32 0d 07 08 19  | feed=feed+2....|
00001b00  20 e7 20 6c 65 66 74 20  8c 20 66 65 65 64 3d 66  | . left . feed=f|
00001b10  65 65 64 2b 34 0d 07 12  1a 20 e7 20 72 69 67 68  |eed+4.... . righ|
00001b20  74 20 8c 20 66 65 65 64  3d 66 65 65 64 2b 38 0d  |t . feed=feed+8.|
00001b30  07 1c 1b 20 e7 20 74 75  72 62 6f 20 8c 20 66 65  |... . turbo . fe|
00001b40  65 64 3d 66 65 65 64 2b  31 36 0d 07 26 20 20 e7  |ed=feed+16..&  .|
00001b50  20 6f 70 65 6e 63 74 65  72 3e 30 20 8c 20 66 65  | opencter>0 . fe|
00001b60  65 64 3d 66 65 65 64 2b  33 32 0d 07 30 0a 20 3d  |ed=feed+32..0. =|
00001b70  66 65 65 64 0d 07 3a 06  20 3a 0d 07 44 28 20 f4  |feed..:. :..D( .|
00001b80  20 50 65 72 66 6f 72 6d  20 61 20 73 77 65 65 70  | Perform a sweep|
00001b90  20 74 6f 20 66 69 6e 64  20 61 6e 79 20 62 61 6c  | to find any bal|
00001ba0  6c 73 0d 07 4e 0b 20 dd  f2 68 75 6e 74 0d 07 58  |ls..N. ..hunt..X|
00001bb0  23 20 f4 20 57 61 74 63  68 20 6f 75 74 20 69 66  |# . Watch out if|
00001bc0  20 74 6f 6f 20 6e 65 61  72 20 74 6f 20 6e 65 74  | too near to net|
00001bd0  0d 07 62 be 20 e7 28 28  66 72 65 71 61 3c 32 30  |..b. .((freqa<20|
00001be0  80 20 66 61 24 3c 3e 22  42 22 29 84 28 66 72 65  |. fa$<>"B").(fre|
00001bf0  71 62 3c 32 30 80 20 66  62 24 3c 3e 22 42 22 29  |qb<20. fb$<>"B")|
00001c00  84 28 66 72 65 71 63 3c  32 30 80 20 66 63 24 3c  |.(freqc<20. fc$<|
00001c10  3e 22 42 22 29 29 84 28  72 65 76 69 6e 67 20 80  |>"B")).(reving .|
00001c20  28 28 66 72 65 71 61 3c  31 35 30 80 20 66 61 24  |((freqa<150. fa$|
00001c30  3c 3e 22 42 22 29 84 28  66 72 65 71 62 3c 31 35  |<>"B").(freqb<15|
00001c40  30 80 20 66 62 24 3c 3e  22 42 22 29 84 28 66 72  |0. fb$<>"B").(fr|
00001c50  65 71 63 3c 31 35 30 80  20 66 63 24 3c 3e 22 42  |eqc<150. fc$<>"B|
00001c60  22 29 29 29 8c 72 65 76  69 6e 67 3d b9 3a 72 65  |"))).reving=.:re|
00001c70  76 65 72 73 65 3d b9 3a  66 77 64 3d a3 3a 6c 65  |verse=.:fwd=.:le|
00001c80  66 74 3d a3 3a 72 69 67  68 74 3d b9 3a e1 0d 07  |ft=.:right=.:...|
00001c90  6c 0d 20 72 65 76 69 6e  67 3d a3 0d 07 76 06 20  |l. reving=...v. |
00001ca0  3a 0d 07 80 3a 20 f4 20  49 66 20 42 61 6c 6c 20  |:...: . If Ball |
00001cb0  69 73 20 6f 75 74 20 6f  66 20 72 65 61 63 68 20  |is out of reach |
00001cc0  69 6e 20 74 68 65 20 22  44 22 20 73 65 63 74 6f  |in the "D" secto|
00001cd0  72 2c 20 72 65 76 65 72  73 65 21 0d 07 8a bf 20  |r, reverse!.... |
00001ce0  46 44 52 3d 66 72 65 71  64 2a 31 2e 32 35 3a e7  |FDR=freqd*1.25:.|
00001cf0  66 72 65 71 64 3c 31 35  30 80 66 64 24 3d 22 42  |freqd<150.fd$="B|
00001d00  22 80 46 44 52 3c 66 72  65 71 61 20 80 46 44 52  |".FDR<freqa .FDR|
00001d10  3c 66 72 65 71 62 20 80  46 44 52 3c 66 72 65 71  |<freqb .FDR<freq|
00001d20  63 20 80 28 66 61 24 3c  3e 22 42 22 84 66 72 65  |c .(fa$<>"B".fre|
00001d30  71 61 3e 31 30 30 29 80  28 66 62 24 3c 3e 22 42  |qa>100).(fb$<>"B|
00001d40  22 84 66 72 65 71 62 3e  31 30 30 29 80 28 66 63  |".freqb>100).(fc|
00001d50  24 3c 3e 22 42 22 84 66  72 65 71 63 3e 31 30 30  |$<>"B".freqc>100|
00001d60  29 8c 20 74 75 72 62 6f  3d b9 3a 72 65 76 65 72  |). turbo=.:rever|
00001d70  73 65 3d b9 3a 66 77 64  3d a3 3a 72 69 67 68 74  |se=.:fwd=.:right|
00001d80  3d b9 3a 66 61 72 6c 65  66 74 3d 2d 36 2a 28 66  |=.:farleft=-6*(f|
00001d90  72 65 71 64 3e 34 30 29  3a e1 0d 07 94 12 20 e7  |reqd>40):..... .|
00001da0  20 66 61 72 6c 65 66 74  3e 30 20 8c 0d 07 9e 37  | farleft>0 ....7|
00001db0  20 20 66 61 72 6c 65 66  74 3d 66 61 72 6c 65 66  |  farleft=farlef|
00001dc0  74 2d 31 3a 72 65 76 65  72 73 65 3d b9 3a 66 77  |t-1:reverse=.:fw|
00001dd0  64 3d a3 3a 72 69 67 68  74 3d b9 3a 74 75 72 62  |d=.:right=.:turb|
00001de0  6f 3d b9 0d 07 a8 33 20  20 e7 20 66 61 24 3d 22  |o=....3  . fa$="|
00001df0  42 22 20 84 20 28 66 64  24 3c 3e 22 42 22 20 80  |B" . (fd$<>"B" .|
00001e00  20 66 62 24 3c 3e 22 42  22 29 20 8c 20 66 61 72  | fb$<>"B") . far|
00001e10  6c 65 66 74 3d 30 0d 07  b2 07 20 20 e1 0d 07 bc  |left=0....  ....|
00001e20  06 20 cd 0d 07 c6 06 20  3a 0d 07 d0 1a 20 f4 20  |. ..... :.... . |
00001e30  52 6f 74 61 74 65 20 74  6f 20 66 61 63 65 20 62  |Rotate to face b|
00001e40  61 6c 6c 0d 07 d2 40 20  e7 20 28 66 62 24 3d 22  |all...@ . (fb$="|
00001e50  42 22 20 80 20 66 72 65  71 62 3e 31 35 30 29 20  |B" . freqb>150) |
00001e60  84 20 28 66 64 24 3d 22  42 22 20 80 20 66 72 65  |. (fd$="B" . fre|
00001e70  71 64 3e 31 35 30 29 20  8c 20 74 65 6e 64 69 6e  |qd>150) . tendin|
00001e80  67 3d 30 0d 07 d3 26 20  e7 20 66 63 24 3d 22 42  |g=0...& . fc$="B|
00001e90  22 20 80 20 66 72 65 71  63 3e 31 35 30 20 8c 20  |" . freqc>150 . |
00001ea0  74 65 6e 64 69 6e 67 3d  31 0d 07 d5 29 20 e7 20  |tending=1...) . |
00001eb0  6f 70 65 6e 63 74 65 72  3e 30 20 8c 20 6f 70 65  |opencter>0 . ope|
00001ec0  6e 63 74 65 72 3d 6f 70  65 6e 63 74 65 72 2d 31  |ncter=opencter-1|
00001ed0  3a e1 0d 07 da 66 20 6f  70 65 6e 63 74 65 72 3d  |:....f opencter=|
00001ee0  2d 35 2a 28 28 28 66 72  65 71 61 3c 32 30 29 80  |-5*(((freqa<20).|
00001ef0  66 61 24 3d 22 42 22 29  84 28 28 66 72 65 71 62  |fa$="B").((freqb|
00001f00  3c 32 30 29 80 66 62 24  3d 22 42 22 29 84 28 28  |<20).fb$="B").((|
00001f10  66 72 65 71 63 3c 32 30  29 80 66 63 24 3d 22 42  |freqc<20).fc$="B|
00001f20  22 29 84 28 28 66 72 65  71 64 3c 32 30 29 80 66  |").((freqd<20).f|
00001f30  64 24 3d 22 42 22 29 29  0d 07 e4 60 20 e7 20 66  |d$="B"))...` . f|
00001f40  61 24 3d 22 42 22 20 8c  20 6c 65 66 74 3d 28 73  |a$="B" . left=(s|
00001f50  74 65 65 72 3d 2d 31 29  3a 72 69 67 68 74 3d 28  |teer=-1):right=(|
00001f60  73 74 65 65 72 3d 31 29  3a 73 74 65 65 72 3d 30  |steer=1):steer=0|
00001f70  3a 73 65 61 72 63 68 69  6e 67 3d 73 65 61 72 63  |:searching=searc|
00001f80  68 69 6e 67 2f 32 3a 74  75 72 62 6f 3d 66 72 65  |hing/2:turbo=fre|
00001f90  71 61 3e 31 30 30 3a e1  0d 07 ee 2c 20 e7 20 66  |qa>100:...., . f|
00001fa0  62 24 3d 22 42 22 20 84  20 66 64 24 3d 22 42 22  |b$="B" . fd$="B"|
00001fb0  20 8c 20 73 74 65 65 72  3d 2d 31 3a 6c 65 66 74  | . steer=-1:left|
00001fc0  3d b9 3a e1 0d 07 f8 22  20 e7 20 66 63 24 3d 22  |=.:...." . fc$="|
00001fd0  42 22 20 8c 20 73 74 65  65 72 3d 31 3a 72 69 67  |B" . steer=1:rig|
00001fe0  68 74 3d b9 3a e1 0d 08  02 30 20 f4 20 49 66 20  |ht=.:....0 . If |
00001ff0  6e 6f 20 62 61 6c 6c 20  69 6e 20 73 69 67 68 74  |no ball in sight|
00002000  2c 20 63 6f 6e 74 69 6e  75 65 20 72 6f 74 61 74  |, continue rotat|
00002010  69 6f 6e 2e 2e 2e 0d 08  0c 22 20 61 6c 69 67 6e  |ion......" align|
00002020  3d a3 3a 73 65 61 72 63  68 69 6e 67 3d 73 65 61  |=.:searching=sea|
00002030  72 63 68 69 6e 67 2b 31  0d 08 16 2a 20 e7 20 28  |rching+1...* . (|
00002040  74 65 6e 64 69 6e 67 20  80 20 31 29 3c 3e 30 20  |tending . 1)<>0 |
00002050  8c 20 72 69 67 68 74 3d  b9 20 8b 20 6c 65 66 74  |. right=. . left|
00002060  3d b9 0d 08 20 2a 20 e7  20 73 65 61 72 63 68 69  |=... * . searchi|
00002070  6e 67 3d 35 20 8c 20 74  65 6e 64 69 6e 67 3d 28  |ng=5 . tending=(|
00002080  74 65 6e 64 69 6e 67 20  82 20 31 29 0d 08 34 24  |tending . 1)..4$|
00002090  20 e7 20 73 65 61 72 63  68 69 6e 67 3e 31 35 30  | . searching>150|
000020a0  20 8c 20 73 74 61 67 65  3d 73 74 61 67 65 2b 31  | . stage=stage+1|
000020b0  0d 08 3e 06 20 e1 0d 08  48 06 20 3a 0d 08 52 3c  |..>. ...H. :..R<|
000020c0  20 f4 20 46 69 6e 64 20  65 64 67 65 20 6f 66 20  | . Find edge of |
000020d0  6e 65 74 20 61 6e 64 20  61 69 6d 20 66 6f 72 20  |net and aim for |
000020e0  69 74 20 74 6f 20 6d 6f  76 65 20 74 6f 20 6f 74  |it to move to ot|
000020f0  68 65 72 20 73 69 64 65  0d 08 5c 0e 20 dd f2 6d  |her side..\. ..m|
00002100  6f 76 65 6f 75 74 0d 08  66 23 20 f4 20 57 61 74  |oveout..f# . Wat|
00002110  63 68 20 6f 75 74 20 69  66 20 74 6f 6f 20 6e 65  |ch out if too ne|
00002120  61 72 20 74 6f 20 6e 65  74 0d 08 70 b0 20 e7 20  |ar to net..p. . |
00002130  28 66 72 65 71 61 3c 33  30 20 84 20 66 72 65 71  |(freqa<30 . freq|
00002140  62 3c 33 30 20 84 20 66  72 65 71 63 3c 33 30 29  |b<30 . freqc<30)|
00002150  20 84 20 28 72 65 76 69  6e 67 20 80 20 28 66 72  | . (reving . (fr|
00002160  65 71 61 3c 32 35 30 20  84 20 66 72 65 71 62 3c  |eqa<250 . freqb<|
00002170  32 35 30 20 84 20 66 72  65 71 63 3c 32 35 30 29  |250 . freqc<250)|
00002180  29 20 8c 20 72 65 76 69  6e 67 3d b9 3a 66 61 72  |) . reving=.:far|
00002190  6c 65 66 74 3d 30 3a 72  65 76 65 72 73 65 3d b9  |left=0:reverse=.|
000021a0  3a 66 77 64 3d a3 3a 72  69 67 68 74 3d a3 3a 6c  |:fwd=.:right=.:l|
000021b0  65 66 74 3d 28 66 72 65  71 61 3e 32 33 30 20 80  |eft=(freqa>230 .|
000021c0  20 66 72 65 71 62 3e 32  33 30 20 80 20 66 72 65  | freqb>230 . fre|
000021d0  71 63 3e 32 33 30 29 3a  e1 0d 08 7a 0d 20 72 65  |qc>230):...z. re|
000021e0  76 69 6e 67 3d a3 0d 08  84 2c 20 f4 20 41 6c 69  |ving=...., . Ali|
000021f0  67 6e 20 62 61 6c 6c 62  6f 74 20 74 6f 20 66 61  |gn ballbot to fa|
00002200  63 65 20 74 68 65 20 6e  65 74 20 70 6f 73 74 2e  |ce the net post.|
00002210  2e 2e 0d 08 8e 24 20 e7  20 66 61 24 3d 22 4e 22  |.....$ . fa$="N"|
00002220  20 84 20 66 61 24 3d 22  50 22 20 8c 20 72 69 67  | . fa$="P" . rig|
00002230  68 74 3d b9 3a e1 0d 08  98 25 20 e7 20 66 62 24  |ht=.:....% . fb$|
00002240  3c 3e 22 4e 22 20 80 20  66 62 24 3c 3e 22 50 22  |<>"N" . fb$<>"P"|
00002250  20 8c 20 6c 65 66 74 3d  b9 3a e1 0d 08 a2 2d 20  | . left=.:....- |
00002260  e7 20 66 62 24 3d 22 50  22 20 80 20 66 72 65 71  |. fb$="P" . freq|
00002270  62 3c 31 35 30 20 8c 20  72 69 67 68 74 3d b9 3a  |b<150 . right=.:|
00002280  6e 65 61 72 3d 31 3a e1  0d 08 ac 0c 20 74 75 72  |near=1:..... tur|
00002290  62 6f 3d b9 0d 08 d4 06  20 e1 0d 08 de 06 20 3a  |bo=..... ..... :|
000022a0  0d 08 e8 47 20 f4 20 4e  65 61 72 6c 79 20 74 68  |...G . Nearly th|
000022b0  65 72 65 2e 2e 2e 20 4a  75 73 74 20 6e 65 65 64  |ere... Just need|
000022c0  20 61 20 6c 69 74 74 6c  65 20 6e 75 64 67 65 20  | a little nudge |
000022d0  69 6e 20 74 68 65 20 72  69 67 68 74 20 64 69 72  |in the right dir|
000022e0  65 63 74 69 6f 6e 2e 0d  08 f2 12 20 dd f2 64 6f  |ection..... ..do|
000022f0  6e 65 61 72 73 74 75 66  66 0d 08 fc 10 20 6e 65  |nearstuff.... ne|
00002300  61 72 3d 6e 65 61 72 2b  31 0d 09 06 19 20 e7 20  |ar=near+1.... . |
00002310  6e 65 61 72 3c 38 20 8c  20 72 69 67 68 74 3d b9  |near<8 . right=.|
00002320  3a e1 0d 09 10 0b 20 6c  65 66 74 3d b9 0d 09 1a  |:..... left=....|
00002330  3b 20 e7 20 6e 65 61 72  3e 31 36 20 8c 20 6e 65  |; . near>16 . ne|
00002340  61 72 3d 30 3a 73 74 61  67 65 3d 73 74 61 67 65  |ar=0:stage=stage|
00002350  2b 31 3a 73 65 61 72 63  68 69 6e 67 3d 30 3a 74  |+1:searching=0:t|
00002360  65 6e 64 69 6e 67 3d 31  0d 09 24 06 20 e1 0d 09  |ending=1..$. ...|
00002370  2e 06 20 3a 0d 09 38 3d  20 f4 20 49 6e 69 74 69  |.. :..8= . Initi|
00002380  61 6c 69 73 65 20 42 61  6c 6c 42 6f 74 20 76 61  |alise BallBot va|
00002390  72 69 61 62 6c 65 73 20  61 74 20 74 68 65 20 62  |riables at the b|
000023a0  65 67 69 6e 6e 69 6e 67  20 6f 66 20 61 20 72 75  |eginning of a ru|
000023b0  6e 0d 09 42 0e 20 dd f2  73 65 74 75 70 62 62 0d  |n..B. ..setupbb.|
000023c0  09 4c 3f 20 72 65 76 69  6e 67 3d a3 3a 6c 65 66  |.L? reving=.:lef|
000023d0  74 3d a3 3a 72 69 67 68  74 3d a3 3a 66 77 64 3d  |t=.:right=.:fwd=|
000023e0  a3 3a 72 65 76 65 72 73  65 3d a3 3a 73 65 61 72  |.:reverse=.:sear|
000023f0  63 68 69 6e 67 3d 30 3a  69 64 6c 65 3d b9 0d 09  |ching=0:idle=...|
00002400  56 32 20 6e 65 61 72 3d  a3 3a 66 61 72 6c 65 66  |V2 near=.:farlef|
00002410  74 3d 30 3a 6f 70 65 6e  63 74 65 72 3d 30 3a 74  |t=0:opencter=0:t|
00002420  65 6e 64 69 6e 67 3d 31  3a 73 74 65 65 72 3d 30  |ending=1:steer=0|
00002430  0d 09 60 06 20 e1 0d 09  6a 06 20 3a 0d 09 74 0f  |..`. ...j. :..t.|
00002440  20 dd f2 72 65 6c 65 61  73 65 62 0d 09 7e 2d 20  | ..releaseb..~- |
00002450  f4 20 47 6f 74 20 61 6c  6c 20 74 68 65 20 62 61  |. Got all the ba|
00002460  6c 6c 73 2c 20 6e 6f 77  20 6a 75 73 74 20 64 75  |lls, now just du|
00002470  6d 70 20 74 68 65 6d 21  0d 09 88 20 20 6e 65 61  |mp them!...  nea|
00002480  72 3d 6e 65 61 72 2b 31  3a 72 65 76 65 72 73 65  |r=near+1:reverse|
00002490  3d b9 3a 66 77 64 3d a3  0d 09 92 1d 20 e7 20 6e  |=.:fwd=..... . n|
000024a0  65 61 72 3e 39 20 8c 20  69 64 6c 65 3d b9 3a 6e  |ear>9 . idle=.:n|
000024b0  65 61 72 3d a3 0d 09 9c  06 20 e1 0d 09 a6 44 20  |ear=..... ....D |
000024c0  f5 3a e3 58 3d 31 b8 31  32 3a ff 22 43 48 41 4e  |.:.X=1.12:."CHAN|
000024d0  4e 45 4c 56 4f 49 43 45  20 31 20 22 2b c3 58 3a  |NELVOICE 1 "+.X:|
000024e0  d4 31 2c 2d 31 30 2c 35  32 2c 31 30 30 3a e3 52  |.1,-10,52,100:.R|
000024f0  3d 30 b8 31 30 30 30 30  3a ed 2c 3a fd 20 a3 0d  |=0.10000:.,:. ..|
00002500  09 b0 06 20 3a 0d 09 ba  42 20 f4 20 57 68 69 7a  |... :...B . Whiz|
00002510  7a 2d 62 61 63 6b 20 74  6f 20 6c 69 6e 65 20 75  |z-back to line u|
00002520  70 20 77 69 74 68 20 44  20 2d 20 77 68 61 74 20  |p with D - what |
00002530  69 66 20 77 68 69 7a 7a  20 62 61 63 6b 20 69 6e  |if whizz back in|
00002540  74 6f 20 6e 65 74 3f 0d  09 c4 39 20 f4 20 52 65  |to net?...9 . Re|
00002550  76 65 72 73 65 20 69 66  20 42 61 6c 6c 42 6f 74  |verse if BallBot|
00002560  20 6b 6e 6f 77 73 20 74  68 61 74 20 62 61 6c 6c  | knows that ball|
00002570  73 20 61 72 65 20 62 65  68 69 6e 64 20 69 74 2e  |s are behind it.|
00002580  0d ff                                             |..|
00002582
BioBot/BBNew.m0
BioBot/BBNew.m1
BioBot/BBNew.m2
BioBot/BBNew.m4
BioBot/BBNew.m5