Home » Personal collection » Acorn ADFS disks » Archimedes » Files.ADF » BioBot/Ballbot
BioBot/Ballbot
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn ADFS disks » Archimedes » Files.ADF |
Filename: | BioBot/Ballbot |
Read OK: | ✔ |
File size: | 1054 bytes |
Load address: | FFFFFB45 |
Exec address: | AA42EF7C |
Duplicates
There are 5 duplicate copies of this file in the archive:
- Personal collection » Acorn ADFS disks » Archimedes » Dominic_4.ADF » TEMP
- Personal collection » Acorn ADFS disks » Archimedes » Files.ADF » BioBot/Ballbot
- Personal collection » Acorn ADFS disks » Greaseweazled » adfs_Dominic_4.adf » TEMP
- Personal collection » Acorn ADFS disks » Greaseweazled » dos34_s2312.016_compaq_user_programs.adf » BioBot/Ballbot
- Personal collection » Acorn hard disk » files » BallBot » BioBot/Ballbot
- Personal collection » Acorn hard disk » misc » misc2 » biobot/TEMP
File contents
1 REM BallBot V1.0 2 REM (C) Dominic Ford 1997 5: 7 REM Setup variables 10 VOICE 1,"StringLib-Soft":*STEREO 1 0 13 VOICE 2,"StringLib-Soft":*STEREO 2 -127 16 VOICE 3,"StringLib-Soft":*STEREO 3 127 20 current=0:DIMball(4,1):bbx=640:bby=950:dir=270:PROCsetupbb 25 MODE0:MOUSE ON:PROCdrawfull 27 : 28 REM Start main loop 30 REPEAT:T=TIME 40 PROCuser 50 IF idle THEN UNTIL FALSE 60 PROCsense 70 mov=FNai(freqa,freqb,freqc) 71 fwd=(mov AND 1)<>0 72 reverse=(mov AND 2)<>0 73 left=(mov AND 4)<>0 74 right=(mov AND 8)<>0 80 PROCmoveit 87 REPEAT UNTIL TIME>T+8 90 UNTIL FALSE 100 : 110 REM Graphic interface 1000 DEFPROCdrawfull 1010 CLS:GCOL0,1:RECTANGLE0,0,1279,1023 1020 MOVE 640,100:DRAW 640,924 1030 PROCdrawmini 1040 ENDPROC 1042 : 1044 REM Draw ballbot and balls 1050 DEFPROCdrawmini 1060 GCOL3,1:FORb=0TO4 1070 IF ball(b,0)<>0 OR ball(b,1)<>0 THEN POINT ball(b,0),ball(b,1) 1080 NEXT 1082 GCOL3,1:POINTbbx,bby 1090 ENDPROC 1900 : 1910 REM User interface (putting balls down) 2000 DEFPROCuser 2010 MOUSE x,y,c 2015 IF c=0 THEN ENDPROC 2020 IF (c AND 4)<>0 THEN PROCdrawmini:ball(current,0)=x:ball(current,1)=y:current=(current+1)MOD5:PROCdrawmini 2030 IF (c AND 2)<>0 THEN idle=FALSE:stage=0 2035 REPEAT 2037 MOUSE x,y,c 2038 UNTIL c=0 2040 ENDPROC 2050 : 2060 REM Calculate ballbot's new position 3000 DEFPROCmoveit 3005 IF left THEN dir=dir-5 3007 IF right THEN dir=dir+5 3008 fr=0:IF fwd THEN fr=fr+1 3009 IF reverse THEN fr=fr-1 3010 PROCdrawmini:bbx=bbx+5*SIN(PI*dir/180)*fr 3020 bby=bby+5*COS(PI*dir/180)*fr:PROCdrawmini 3030 ENDPROC 3040 : 4490 REM Calculate ballbot's background echo reading (-balls) 4500 DEFFNback(x,y,freq) 4510 REM Calculate Angle of net as seen by Ballbot 4515 LOCAL freqa 4520 netlow=(FNangle(640,923,x,y)-dir) MOD 360 4525 IF netlow<0 THEN netlow=netlow+360 4527 IF netlow>180 THEN netlow=netlow-360 4530 nethi=(FNangle(640,100,x,y)-dir) MOD 360 4535 IF nethi<0 THEN nethi=nethi+360 4537 IF nethi>180 THEN nethi=nethi-360 4540 : 4550 REM Calculate reading 4560 freqa=freq+RND(6)-3 4570 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) 4580 =freqa 4590 : 4600 DEFPROCsense 4610 REM Calculate Ballbot's readings 4620 freq=RND(250)+1500 4630 freqa=FNback(bbx,bby,freq) 4640 freqb=FNback(bbx-5*COS(PI*dir/180),bby-5*SIN(PI*dir/180),freq) 4650 freqc=FNback(bbx+5*COS(PI*dir/180),bby+5*SIN(PI*dir/180),freq) 4980 PRINTTAB(0,31)netlow,nethi,stage; 4985 SOUND 1,-10,freqa/4,5:SOUND 2,-10,freqb/4,5:SOUND 3,-10,freqc/4,5 4990 ENDPROC 5000: 5005 REM Calculate bearing of B from A 5010 DEFFNangle(x1,y1,x2,y2) 5020 ang=180*ATN((x2-x1)/(y2-y1))/PI 5030 IF (y2>y1) THEN ang=ang+180 5040 =ang MOD 360 5490 : 5500 REM BALLBOT ROBOTIC INTELLIGENCE MODULE 5510 : 6000 DEFFNai(freqa,freqb,freqc) 6010 REM Artificial intelligence routines (ie. What Next??) 6012 LOCALfwd,reverse,left,right 6015 fwd=TRUE:reverse=FALSE:left=FALSE:right=FALSE 6017 : 6018 REM What stage are we in? Hunt for balls or move to new area? 6019 : 6020 IF stage=0 OR stage=2 THEN PROChunt 6030 IF stage=1 OR stage=3 THEN PROCmoveout 6035 IF stage=4 THEN PROCreleaseb 6036 feed=0:IF fwd THEN feed=feed+1 6037 IF reverse THEN feed=feed+2 6038 IF left THEN feed=feed+4 6039 IF right THEN feed=feed+8 6040 =feed 6045 : 6047 REM Perform a sweep to find any balls 6050 DEFPROChunt 6055 IF (freqa<20 AND freqb<20 AND freqc<20) OR (reving AND freqa<100 AND freqb<100 AND freqc<100) THEN searching=searching/2:reving=TRUE:reverse=TRUE:fwd=FALSE:left=FALSE:right=FALSE:ENDPROC 6057 reving=FALSE 6060 IF (freqc*1.5)<freqa AND (freqc*1.5)<freqb THEN right=TRUE:searching=0:ENDPROC 6070 IF (freqb*1.5)<freqa AND (freqb*1.5)<freqc THEN left=TRUE:searching=0:ENDPROC 6080 left=TRUE:searching=searching+1 6090 IF searching>36 THEN stage=stage+1 6100 ENDPROC 6105 : 6107 REM Find edge of net and aim for it to move to other side 6110 DEFPROCmoveout 6111 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 6112 reving=FALSE 6113 IF freqb<40 AND freqa>250 THEN right=TRUE:near=1:ENDPROC 6114 IF freqa<200 AND freqb<200 AND freqc<200 THEN right=TRUE:ENDPROC 6115 IF near<>0 THEN PROCdonearstuff:ENDPROC 6120 IF (freqb*1.5)<freqc AND (freqa*1.5)<freqc THEN right=TRUE:ENDPROC 6130 IF (freqb*1.5)>freqc THEN left=TRUE:ENDPROC 6200 ENDPROC 6205 : 6210 REM Nearly there... Just need a little nudge in the right direction. 6211 DEFPROCdonearstuff 6212 near=near+1 6213 IF near<4 THEN right=TRUE:ENDPROC 6214 left=TRUE 6215 IF near>7 THEN near=0:stage=stage+1 6216 ENDPROC 6217 : 6220 DEFPROCsetupbb 6230 reving=FALSE:left=FALSE:right=FALSE:fwd=FALSE:reverse=FALSE:searching=0:idle=TRUE 6235 near=FALSE 6240 ENDPROC 6250 : 6260 DEFPROCreleaseb 6270 REM Got all the balls, now just dump them! 6280 near=near+1:reverse=TRUE:fwd=FALSE 6290 IF near>9 THEN idle=TRUE:near=FALSE 6300 ENDPROC 20000 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 & ȡ 1,"StringLib-Soft":*STEREO 1 0 ) ȡ 2,"StringLib-Soft":*STEREO 2 -127 ( ȡ 3,"StringLib-Soft":*STEREO 3 127 : current=0:�ball(4,1):bbx=640:bby=950:dir=270:�setupbb �0:ȗ �:�drawfull : � Start main loop �:T=� ( �user 2 � idle � � � < �sense F mov=�ai(freqa,freqb,freqc) G fwd=(mov � 1)<>0 H reverse=(mov � 2)<>0 I left=(mov � 4)<>0 J right=(mov � 8)<>0 P �moveit W � � �>T+8 Z � � d : n � Graphic interface � ��drawfull � �:�0,1:ȓ0,0,1279,1023 � � 640,100:� 640,924 �drawmini � : � Draw ballbot and balls ��drawmini $ �3,1:�b=0�4 .; � ball(b,0)<>0 � ball(b,1)<>0 � Ȓ ball(b,0),ball(b,1) 8 � : �3,1:Ȓbbx,bby B � l : v* � 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 � � � ȗ x,y,c � � c=0 � � : ' � Calculate ballbot's new position � ��moveit � � left � dir=dir-5 � � right � dir=dir+5 � fr=0:� fwd � fr=fr+1 � � reverse � fr=fr-1 �( �drawmini:bbx=bbx+5*�(�*dir/180)*fr �( bby=bby+5*�(�*dir/180)*fr:�drawmini � � � : �; � Calculate ballbot's background echo reading (-balls) � ݤback(x,y,freq) �0 � Calculate Angle of net as seen by Ballbot � � freqa �+ netlow=(�angle(640,923,x,y)-dir) � 360 �# � netlow<0 � netlow=netlow+360 �% � netlow>180 � netlow=netlow-360 �* nethi=(�angle(640,100,x,y)-dir) � 360 � � nethi<0 � nethi=nethi+360 �" � nethi>180 � nethi=nethi-360 � : � � Calculate reading � freqa=freq+�(6)-3 ڃ � �(�(�*dir/180))>0.01 � � ((netlow<0 � nethi>0) � (nethi<0 � netlow>0)) � (640-x)/�(�*dir/180)>0 � freqa=(640-x)/�(�*dir/180) � =freqa � : � ��sense # � Calculate Ballbot's readings freq=�(250)+1500 freqa=�back(bbx,bby,freq) < freqb=�back(bbx-5*�(�*dir/180),bby-5*�(�*dir/180),freq) *< freqc=�back(bbx+5*�(�*dir/180),bby+5*�(�*dir/180),freq) t �0,31)netlow,nethi,stage; y: � 1,-10,freqa/4,5:� 2,-10,freqb/4,5:� 3,-10,freqc/4,5 ~ � �: �$ � Calculate bearing of B from A � ݤangle(x1,y1,x2,y2) �! ang=180*�((x2-x1)/(y2-y1))/� � � (y2>y1) � ang=ang+180 � =ang � 360 r : |* � BALLBOT ROBOTIC INTELLIGENCE MODULE � : p ݤai(freqa,freqb,freqc) z9 � Artificial intelligence routines (ie. What Next??) | �fwd,reverse,left,right # fwd=�:reverse=�:left=�:right=� � : �@ � What stage are we in? Hunt for balls or move to new area? � : � � stage=0 � stage=2 � �hunt �# � stage=1 � stage=3 � �moveout � � stage=4 � �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=searching/2:reving=�:reverse=�:fwd=�:left=�:right=�:� � reving=� �D � (freqc*1.5)<freqa � (freqc*1.5)<freqb � right=�:searching=0:� �C � (freqb*1.5)<freqa � (freqb*1.5)<freqc � left=�:searching=0:� �! left=�:searching=searching+1 �# � searching>36 � stage=stage+1 � � � : �< � 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=�:� � � near<>0 � �donearstuff:� �8 � (freqb*1.5)<freqc � (freqa*1.5)<freqc � right=�:� �# � (freqb*1.5)>freqc � left=�:� 8 � = : BG � Nearly there... Just need a little nudge in the right direction. C ��donearstuff D near=near+1 E � near<4 � right=�:� F left=� G$ � near>7 � near=0:stage=stage+1 H � I : L ��setupbb V? reving=�:left=�:right=�:fwd=�:reverse=�:searching=0:idle=� [ near=� ` � j : t ��releaseb ~- � Got all the balls, now just dump them! � near=near+1:reverse=�:fwd=� � � near>9 � idle=�:near=� � � N D �:�X=1�12:�"CHANNELVOICE 1 "+�X:�1,-10,52,100:�R=0�10000:�,:� � �
00000000 0d 00 01 13 20 f4 20 42 61 6c 6c 42 6f 74 20 56 |.... . BallBot V| 00000010 31 2e 30 0d 00 02 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 05 05 3a 0d 00 07 16 20 f4 20 53 65 74 75 70 |...:.... . Setup| 00000040 20 76 61 72 69 61 62 6c 65 73 0d 00 0a 26 20 c8 | variables...& .| 00000050 a1 20 31 2c 22 53 74 72 69 6e 67 4c 69 62 2d 53 |. 1,"StringLib-S| 00000060 6f 66 74 22 3a 2a 53 54 45 52 45 4f 20 31 20 30 |oft":*STEREO 1 0| 00000070 0d 00 0d 29 20 c8 a1 20 32 2c 22 53 74 72 69 6e |...) .. 2,"Strin| 00000080 67 4c 69 62 2d 53 6f 66 74 22 3a 2a 53 54 45 52 |gLib-Soft":*STER| 00000090 45 4f 20 32 20 2d 31 32 37 0d 00 10 28 20 c8 a1 |EO 2 -127...( ..| 000000a0 20 33 2c 22 53 74 72 69 6e 67 4c 69 62 2d 53 6f | 3,"StringLib-So| 000000b0 66 74 22 3a 2a 53 54 45 52 45 4f 20 33 20 31 32 |ft":*STEREO 3 12| 000000c0 37 0d 00 14 3a 20 63 75 72 72 65 6e 74 3d 30 3a |7...: current=0:| 000000d0 de 62 61 6c 6c 28 34 2c 31 29 3a 62 62 78 3d 36 |.ball(4,1):bbx=6| 000000e0 34 30 3a 62 62 79 3d 39 35 30 3a 64 69 72 3d 32 |40:bby=950:dir=2| 000000f0 37 30 3a f2 73 65 74 75 70 62 62 0d 00 19 16 20 |70:.setupbb.... | 00000100 eb 30 3a c8 97 20 ee 3a f2 64 72 61 77 66 75 6c |.0:.. .:.drawful| 00000110 6c 0d 00 1b 06 20 3a 0d 00 1c 16 20 f4 20 53 74 |l.... :.... . St| 00000120 61 72 74 20 6d 61 69 6e 20 6c 6f 6f 70 0d 00 1e |art main loop...| 00000130 0a 20 f5 3a 54 3d 91 0d 00 28 0a 20 f2 75 73 65 |. .:T=...(. .use| 00000140 72 0d 00 32 11 20 e7 20 69 64 6c 65 20 8c 20 fd |r..2. . idle . .| 00000150 20 a3 0d 00 3c 0b 20 f2 73 65 6e 73 65 0d 00 46 | ...<. .sense..F| 00000160 1f 20 6d 6f 76 3d a4 61 69 28 66 72 65 71 61 2c |. mov=.ai(freqa,| 00000170 66 72 65 71 62 2c 66 72 65 71 63 29 0d 00 47 15 |freqb,freqc)..G.| 00000180 20 66 77 64 3d 28 6d 6f 76 20 80 20 31 29 3c 3e | fwd=(mov . 1)<>| 00000190 30 0d 00 48 19 20 72 65 76 65 72 73 65 3d 28 6d |0..H. reverse=(m| 000001a0 6f 76 20 80 20 32 29 3c 3e 30 0d 00 49 16 20 6c |ov . 2)<>0..I. l| 000001b0 65 66 74 3d 28 6d 6f 76 20 80 20 34 29 3c 3e 30 |eft=(mov . 4)<>0| 000001c0 0d 00 4a 17 20 72 69 67 68 74 3d 28 6d 6f 76 20 |..J. right=(mov | 000001d0 80 20 38 29 3c 3e 30 0d 00 50 0c 20 f2 6d 6f 76 |. 8)<>0..P. .mov| 000001e0 65 69 74 0d 00 57 0e 20 f5 20 fd 20 91 3e 54 2b |eit..W. . . .>T+| 000001f0 38 0d 00 5a 08 20 fd 20 a3 0d 00 64 06 20 3a 0d |8..Z. . ...d. :.| 00000200 00 6e 18 20 f4 20 47 72 61 70 68 69 63 20 69 6e |.n. . Graphic in| 00000210 74 65 72 66 61 63 65 0d 03 e8 0f 20 dd f2 64 72 |terface.... ..dr| 00000220 61 77 66 75 6c 6c 0d 03 f2 1b 20 db 3a e6 30 2c |awfull.... .:.0,| 00000230 31 3a c8 93 30 2c 30 2c 31 32 37 39 2c 31 30 32 |1:..0,0,1279,102| 00000240 33 0d 03 fc 18 20 ec 20 36 34 30 2c 31 30 30 3a |3.... . 640,100:| 00000250 df 20 36 34 30 2c 39 32 34 0d 04 06 0e 20 f2 64 |. 640,924.... .d| 00000260 72 61 77 6d 69 6e 69 0d 04 10 06 20 e1 0d 04 12 |rawmini.... ....| 00000270 06 20 3a 0d 04 14 1d 20 f4 20 44 72 61 77 20 62 |. :.... . Draw b| 00000280 61 6c 6c 62 6f 74 20 61 6e 64 20 62 61 6c 6c 73 |allbot and balls| 00000290 0d 04 1a 0f 20 dd f2 64 72 61 77 6d 69 6e 69 0d |.... ..drawmini.| 000002a0 04 24 10 20 e6 33 2c 31 3a e3 62 3d 30 b8 34 0d |.$. .3,1:.b=0.4.| 000002b0 04 2e 3b 20 e7 20 62 61 6c 6c 28 62 2c 30 29 3c |..; . ball(b,0)<| 000002c0 3e 30 20 84 20 62 61 6c 6c 28 62 2c 31 29 3c 3e |>0 . ball(b,1)<>| 000002d0 30 20 8c 20 c8 92 20 62 61 6c 6c 28 62 2c 30 29 |0 . .. ball(b,0)| 000002e0 2c 62 61 6c 6c 28 62 2c 31 29 0d 04 38 06 20 ed |,ball(b,1)..8. .| 000002f0 0d 04 3a 13 20 e6 33 2c 31 3a c8 92 62 62 78 2c |..:. .3,1:..bbx,| 00000300 62 62 79 0d 04 42 06 20 e1 0d 07 6c 06 20 3a 0d |bby..B. ...l. :.| 00000310 07 76 2a 20 f4 20 55 73 65 72 20 69 6e 74 65 72 |.v* . User inter| 00000320 66 61 63 65 20 28 70 75 74 74 69 6e 67 20 62 61 |face (putting ba| 00000330 6c 6c 73 20 64 6f 77 6e 29 0d 07 d0 0b 20 dd f2 |lls down).... ..| 00000340 75 73 65 72 0d 07 da 0d 20 c8 97 20 78 2c 79 2c |user.... .. x,y,| 00000350 63 0d 07 df 0e 20 e7 20 63 3d 30 20 8c 20 e1 0d |c.... . c=0 . ..| 00000360 07 e4 61 20 e7 20 28 63 20 80 20 34 29 3c 3e 30 |..a . (c . 4)<>0| 00000370 20 8c 20 f2 64 72 61 77 6d 69 6e 69 3a 62 61 6c | . .drawmini:bal| 00000380 6c 28 63 75 72 72 65 6e 74 2c 30 29 3d 78 3a 62 |l(current,0)=x:b| 00000390 61 6c 6c 28 63 75 72 72 65 6e 74 2c 31 29 3d 79 |all(current,1)=y| 000003a0 3a 63 75 72 72 65 6e 74 3d 28 63 75 72 72 65 6e |:current=(curren| 000003b0 74 2b 31 29 83 35 3a f2 64 72 61 77 6d 69 6e 69 |t+1).5:.drawmini| 000003c0 0d 07 ee 22 20 e7 20 28 63 20 80 20 32 29 3c 3e |..." . (c . 2)<>| 000003d0 30 20 8c 20 69 64 6c 65 3d a3 3a 73 74 61 67 65 |0 . idle=.:stage| 000003e0 3d 30 0d 07 f3 06 20 f5 0d 07 f5 0d 20 c8 97 20 |=0.... ..... .. | 000003f0 78 2c 79 2c 63 0d 07 f6 0a 20 fd 20 63 3d 30 0d |x,y,c.... . c=0.| 00000400 07 f8 06 20 e1 0d 08 02 06 20 3a 0d 08 0c 27 20 |... ..... :...' | 00000410 f4 20 43 61 6c 63 75 6c 61 74 65 20 62 61 6c 6c |. Calculate ball| 00000420 62 6f 74 27 73 20 6e 65 77 20 70 6f 73 69 74 69 |bot's new positi| 00000430 6f 6e 0d 0b b8 0d 20 dd f2 6d 6f 76 65 69 74 0d |on.... ..moveit.| 00000440 0b bd 17 20 e7 20 6c 65 66 74 20 8c 20 64 69 72 |... . left . dir| 00000450 3d 64 69 72 2d 35 0d 0b bf 18 20 e7 20 72 69 67 |=dir-5.... . rig| 00000460 68 74 20 8c 20 64 69 72 3d 64 69 72 2b 35 0d 0b |ht . dir=dir+5..| 00000470 c0 19 20 66 72 3d 30 3a e7 20 66 77 64 20 8c 20 |.. fr=0:. fwd . | 00000480 66 72 3d 66 72 2b 31 0d 0b c1 18 20 e7 20 72 65 |fr=fr+1.... . re| 00000490 76 65 72 73 65 20 8c 20 66 72 3d 66 72 2d 31 0d |verse . fr=fr-1.| 000004a0 0b c2 28 20 f2 64 72 61 77 6d 69 6e 69 3a 62 62 |..( .drawmini:bb| 000004b0 78 3d 62 62 78 2b 35 2a b5 28 af 2a 64 69 72 2f |x=bbx+5*.(.*dir/| 000004c0 31 38 30 29 2a 66 72 0d 0b cc 28 20 62 62 79 3d |180)*fr...( bby=| 000004d0 62 62 79 2b 35 2a 9b 28 af 2a 64 69 72 2f 31 38 |bby+5*.(.*dir/18| 000004e0 30 29 2a 66 72 3a f2 64 72 61 77 6d 69 6e 69 0d |0)*fr:.drawmini.| 000004f0 0b d6 06 20 e1 0d 0b e0 06 20 3a 0d 11 8a 3b 20 |... ..... :...; | 00000500 f4 20 43 61 6c 63 75 6c 61 74 65 20 62 61 6c 6c |. Calculate ball| 00000510 62 6f 74 27 73 20 62 61 63 6b 67 72 6f 75 6e 64 |bot's background| 00000520 20 65 63 68 6f 20 72 65 61 64 69 6e 67 20 28 2d | echo reading (-| 00000530 62 61 6c 6c 73 29 0d 11 94 15 20 dd a4 62 61 63 |balls).... ..bac| 00000540 6b 28 78 2c 79 2c 66 72 65 71 29 0d 11 9e 30 20 |k(x,y,freq)...0 | 00000550 f4 20 43 61 6c 63 75 6c 61 74 65 20 41 6e 67 6c |. Calculate Angl| 00000560 65 20 6f 66 20 6e 65 74 20 61 73 20 73 65 65 6e |e of net as seen| 00000570 20 62 79 20 42 61 6c 6c 62 6f 74 0d 11 a3 0c 20 | by Ballbot.... | 00000580 ea 20 66 72 65 71 61 0d 11 a8 2b 20 6e 65 74 6c |. freqa...+ netl| 00000590 6f 77 3d 28 a4 61 6e 67 6c 65 28 36 34 30 2c 39 |ow=(.angle(640,9| 000005a0 32 33 2c 78 2c 79 29 2d 64 69 72 29 20 83 20 33 |23,x,y)-dir) . 3| 000005b0 36 30 0d 11 ad 23 20 e7 20 6e 65 74 6c 6f 77 3c |60...# . netlow<| 000005c0 30 20 8c 20 6e 65 74 6c 6f 77 3d 6e 65 74 6c 6f |0 . netlow=netlo| 000005d0 77 2b 33 36 30 0d 11 af 25 20 e7 20 6e 65 74 6c |w+360...% . netl| 000005e0 6f 77 3e 31 38 30 20 8c 20 6e 65 74 6c 6f 77 3d |ow>180 . netlow=| 000005f0 6e 65 74 6c 6f 77 2d 33 36 30 0d 11 b2 2a 20 6e |netlow-360...* n| 00000600 65 74 68 69 3d 28 a4 61 6e 67 6c 65 28 36 34 30 |ethi=(.angle(640| 00000610 2c 31 30 30 2c 78 2c 79 29 2d 64 69 72 29 20 83 |,100,x,y)-dir) .| 00000620 20 33 36 30 0d 11 b7 20 20 e7 20 6e 65 74 68 69 | 360... . nethi| 00000630 3c 30 20 8c 20 6e 65 74 68 69 3d 6e 65 74 68 69 |<0 . nethi=nethi| 00000640 2b 33 36 30 0d 11 b9 22 20 e7 20 6e 65 74 68 69 |+360..." . nethi| 00000650 3e 31 38 30 20 8c 20 6e 65 74 68 69 3d 6e 65 74 |>180 . nethi=net| 00000660 68 69 2d 33 36 30 0d 11 bc 06 20 3a 0d 11 c6 18 |hi-360.... :....| 00000670 20 f4 20 43 61 6c 63 75 6c 61 74 65 20 72 65 61 | . Calculate rea| 00000680 64 69 6e 67 0d 11 d0 16 20 66 72 65 71 61 3d 66 |ding.... freqa=f| 00000690 72 65 71 2b b3 28 36 29 2d 33 0d 11 da 83 20 e7 |req+.(6)-3.... .| 000006a0 20 94 28 b5 28 af 2a 64 69 72 2f 31 38 30 29 29 | .(.(.*dir/180))| 000006b0 3e 30 2e 30 31 20 8c 20 e7 20 28 28 6e 65 74 6c |>0.01 . . ((netl| 000006c0 6f 77 3c 30 20 80 20 6e 65 74 68 69 3e 30 29 20 |ow<0 . nethi>0) | 000006d0 84 20 28 6e 65 74 68 69 3c 30 20 80 20 6e 65 74 |. (nethi<0 . net| 000006e0 6c 6f 77 3e 30 29 29 20 80 20 28 36 34 30 2d 78 |low>0)) . (640-x| 000006f0 29 2f b5 28 af 2a 64 69 72 2f 31 38 30 29 3e 30 |)/.(.*dir/180)>0| 00000700 20 8c 20 66 72 65 71 61 3d 28 36 34 30 2d 78 29 | . freqa=(640-x)| 00000710 2f b5 28 af 2a 64 69 72 2f 31 38 30 29 0d 11 e4 |/.(.*dir/180)...| 00000720 0b 20 3d 66 72 65 71 61 0d 11 ee 06 20 3a 0d 11 |. =freqa.... :..| 00000730 f8 0c 20 dd f2 73 65 6e 73 65 0d 12 02 23 20 f4 |.. ..sense...# .| 00000740 20 43 61 6c 63 75 6c 61 74 65 20 42 61 6c 6c 62 | Calculate Ballb| 00000750 6f 74 27 73 20 72 65 61 64 69 6e 67 73 0d 12 0c |ot's readings...| 00000760 15 20 66 72 65 71 3d b3 28 32 35 30 29 2b 31 35 |. freq=.(250)+15| 00000770 30 30 0d 12 16 1e 20 66 72 65 71 61 3d a4 62 61 |00.... freqa=.ba| 00000780 63 6b 28 62 62 78 2c 62 62 79 2c 66 72 65 71 29 |ck(bbx,bby,freq)| 00000790 0d 12 20 3c 20 66 72 65 71 62 3d a4 62 61 63 6b |.. < freqb=.back| 000007a0 28 62 62 78 2d 35 2a 9b 28 af 2a 64 69 72 2f 31 |(bbx-5*.(.*dir/1| 000007b0 38 30 29 2c 62 62 79 2d 35 2a b5 28 af 2a 64 69 |80),bby-5*.(.*di| 000007c0 72 2f 31 38 30 29 2c 66 72 65 71 29 0d 12 2a 3c |r/180),freq)..*<| 000007d0 20 66 72 65 71 63 3d a4 62 61 63 6b 28 62 62 78 | freqc=.back(bbx| 000007e0 2b 35 2a 9b 28 af 2a 64 69 72 2f 31 38 30 29 2c |+5*.(.*dir/180),| 000007f0 62 62 79 2b 35 2a b5 28 af 2a 64 69 72 2f 31 38 |bby+5*.(.*dir/18| 00000800 30 29 2c 66 72 65 71 29 0d 13 74 1f 20 f1 8a 30 |0),freq)..t. ..0| 00000810 2c 33 31 29 6e 65 74 6c 6f 77 2c 6e 65 74 68 69 |,31)netlow,nethi| 00000820 2c 73 74 61 67 65 3b 0d 13 79 3a 20 d4 20 31 2c |,stage;..y: . 1,| 00000830 2d 31 30 2c 66 72 65 71 61 2f 34 2c 35 3a d4 20 |-10,freqa/4,5:. | 00000840 32 2c 2d 31 30 2c 66 72 65 71 62 2f 34 2c 35 3a |2,-10,freqb/4,5:| 00000850 d4 20 33 2c 2d 31 30 2c 66 72 65 71 63 2f 34 2c |. 3,-10,freqc/4,| 00000860 35 0d 13 7e 06 20 e1 0d 13 88 05 3a 0d 13 8d 24 |5..~. .....:...$| 00000870 20 f4 20 43 61 6c 63 75 6c 61 74 65 20 62 65 61 | . Calculate bea| 00000880 72 69 6e 67 20 6f 66 20 42 20 66 72 6f 6d 20 41 |ring of B from A| 00000890 0d 13 92 19 20 dd a4 61 6e 67 6c 65 28 78 31 2c |.... ..angle(x1,| 000008a0 79 31 2c 78 32 2c 79 32 29 0d 13 9c 21 20 61 6e |y1,x2,y2)...! an| 000008b0 67 3d 31 38 30 2a 99 28 28 78 32 2d 78 31 29 2f |g=180*.((x2-x1)/| 000008c0 28 79 32 2d 79 31 29 29 2f af 0d 13 a6 1c 20 e7 |(y2-y1))/..... .| 000008d0 20 28 79 32 3e 79 31 29 20 8c 20 61 6e 67 3d 61 | (y2>y1) . ang=a| 000008e0 6e 67 2b 31 38 30 0d 13 b0 0f 20 3d 61 6e 67 20 |ng+180.... =ang | 000008f0 83 20 33 36 30 0d 15 72 06 20 3a 0d 15 7c 2a 20 |. 360..r. :..|* | 00000900 f4 20 42 41 4c 4c 42 4f 54 20 52 4f 42 4f 54 49 |. BALLBOT ROBOTI| 00000910 43 20 49 4e 54 45 4c 4c 49 47 45 4e 43 45 20 4d |C INTELLIGENCE M| 00000920 4f 44 55 4c 45 0d 15 86 06 20 3a 0d 17 70 1c 20 |ODULE.... :..p. | 00000930 dd a4 61 69 28 66 72 65 71 61 2c 66 72 65 71 62 |..ai(freqa,freqb| 00000940 2c 66 72 65 71 63 29 0d 17 7a 39 20 f4 20 41 72 |,freqc)..z9 . Ar| 00000950 74 69 66 69 63 69 61 6c 20 69 6e 74 65 6c 6c 69 |tificial intelli| 00000960 67 65 6e 63 65 20 72 6f 75 74 69 6e 65 73 20 28 |gence routines (| 00000970 69 65 2e 20 57 68 61 74 20 4e 65 78 74 3f 3f 29 |ie. What Next??)| 00000980 0d 17 7c 1c 20 ea 66 77 64 2c 72 65 76 65 72 73 |..|. .fwd,revers| 00000990 65 2c 6c 65 66 74 2c 72 69 67 68 74 0d 17 7f 23 |e,left,right...#| 000009a0 20 66 77 64 3d b9 3a 72 65 76 65 72 73 65 3d a3 | fwd=.:reverse=.| 000009b0 3a 6c 65 66 74 3d a3 3a 72 69 67 68 74 3d a3 0d |:left=.:right=..| 000009c0 17 81 06 20 3a 0d 17 82 40 20 f4 20 57 68 61 74 |... :...@ . What| 000009d0 20 73 74 61 67 65 20 61 72 65 20 77 65 20 69 6e | stage are we in| 000009e0 3f 20 48 75 6e 74 20 66 6f 72 20 62 61 6c 6c 73 |? Hunt for balls| 000009f0 20 6f 72 20 6d 6f 76 65 20 74 6f 20 6e 65 77 20 | or move to new | 00000a00 61 72 65 61 3f 0d 17 83 06 20 3a 0d 17 84 20 20 |area?.... :... | 00000a10 e7 20 73 74 61 67 65 3d 30 20 84 20 73 74 61 67 |. stage=0 . stag| 00000a20 65 3d 32 20 8c 20 f2 68 75 6e 74 0d 17 8e 23 20 |e=2 . .hunt...# | 00000a30 e7 20 73 74 61 67 65 3d 31 20 84 20 73 74 61 67 |. stage=1 . stag| 00000a40 65 3d 33 20 8c 20 f2 6d 6f 76 65 6f 75 74 0d 17 |e=3 . .moveout..| 00000a50 93 1a 20 e7 20 73 74 61 67 65 3d 34 20 8c 20 f2 |.. . stage=4 . .| 00000a60 72 65 6c 65 61 73 65 62 0d 17 94 1f 20 66 65 65 |releaseb.... fee| 00000a70 64 3d 30 3a e7 20 66 77 64 20 8c 20 66 65 65 64 |d=0:. fwd . feed| 00000a80 3d 66 65 65 64 2b 31 0d 17 95 1c 20 e7 20 72 65 |=feed+1.... . re| 00000a90 76 65 72 73 65 20 8c 20 66 65 65 64 3d 66 65 65 |verse . feed=fee| 00000aa0 64 2b 32 0d 17 96 19 20 e7 20 6c 65 66 74 20 8c |d+2.... . left .| 00000ab0 20 66 65 65 64 3d 66 65 65 64 2b 34 0d 17 97 1a | feed=feed+4....| 00000ac0 20 e7 20 72 69 67 68 74 20 8c 20 66 65 65 64 3d | . right . feed=| 00000ad0 66 65 65 64 2b 38 0d 17 98 0a 20 3d 66 65 65 64 |feed+8.... =feed| 00000ae0 0d 17 9d 06 20 3a 0d 17 9f 28 20 f4 20 50 65 72 |.... :...( . Per| 00000af0 66 6f 72 6d 20 61 20 73 77 65 65 70 20 74 6f 20 |form a sweep to | 00000b00 66 69 6e 64 20 61 6e 79 20 62 61 6c 6c 73 0d 17 |find any balls..| 00000b10 a2 0b 20 dd f2 68 75 6e 74 0d 17 a7 98 20 e7 20 |.. ..hunt.... . | 00000b20 28 66 72 65 71 61 3c 32 30 20 80 20 66 72 65 71 |(freqa<20 . freq| 00000b30 62 3c 32 30 20 80 20 66 72 65 71 63 3c 32 30 29 |b<20 . freqc<20)| 00000b40 20 84 20 28 72 65 76 69 6e 67 20 80 20 66 72 65 | . (reving . fre| 00000b50 71 61 3c 31 30 30 20 80 20 66 72 65 71 62 3c 31 |qa<100 . freqb<1| 00000b60 30 30 20 80 20 66 72 65 71 63 3c 31 30 30 29 20 |00 . freqc<100) | 00000b70 8c 20 73 65 61 72 63 68 69 6e 67 3d 73 65 61 72 |. searching=sear| 00000b80 63 68 69 6e 67 2f 32 3a 72 65 76 69 6e 67 3d b9 |ching/2:reving=.| 00000b90 3a 72 65 76 65 72 73 65 3d b9 3a 66 77 64 3d a3 |:reverse=.:fwd=.| 00000ba0 3a 6c 65 66 74 3d a3 3a 72 69 67 68 74 3d a3 3a |:left=.:right=.:| 00000bb0 e1 0d 17 a9 0d 20 72 65 76 69 6e 67 3d a3 0d 17 |..... reving=...| 00000bc0 ac 44 20 e7 20 28 66 72 65 71 63 2a 31 2e 35 29 |.D . (freqc*1.5)| 00000bd0 3c 66 72 65 71 61 20 80 20 28 66 72 65 71 63 2a |<freqa . (freqc*| 00000be0 31 2e 35 29 3c 66 72 65 71 62 20 8c 20 72 69 67 |1.5)<freqb . rig| 00000bf0 68 74 3d b9 3a 73 65 61 72 63 68 69 6e 67 3d 30 |ht=.:searching=0| 00000c00 3a e1 0d 17 b6 43 20 e7 20 28 66 72 65 71 62 2a |:....C . (freqb*| 00000c10 31 2e 35 29 3c 66 72 65 71 61 20 80 20 28 66 72 |1.5)<freqa . (fr| 00000c20 65 71 62 2a 31 2e 35 29 3c 66 72 65 71 63 20 8c |eqb*1.5)<freqc .| 00000c30 20 6c 65 66 74 3d b9 3a 73 65 61 72 63 68 69 6e | left=.:searchin| 00000c40 67 3d 30 3a e1 0d 17 c0 21 20 6c 65 66 74 3d b9 |g=0:....! left=.| 00000c50 3a 73 65 61 72 63 68 69 6e 67 3d 73 65 61 72 63 |:searching=searc| 00000c60 68 69 6e 67 2b 31 0d 17 ca 23 20 e7 20 73 65 61 |hing+1...# . sea| 00000c70 72 63 68 69 6e 67 3e 33 36 20 8c 20 73 74 61 67 |rching>36 . stag| 00000c80 65 3d 73 74 61 67 65 2b 31 0d 17 d4 06 20 e1 0d |e=stage+1.... ..| 00000c90 17 d9 06 20 3a 0d 17 db 3c 20 f4 20 46 69 6e 64 |... :...< . Find| 00000ca0 20 65 64 67 65 20 6f 66 20 6e 65 74 20 61 6e 64 | edge of net and| 00000cb0 20 61 69 6d 20 66 6f 72 20 69 74 20 74 6f 20 6d | aim for it to m| 00000cc0 6f 76 65 20 74 6f 20 6f 74 68 65 72 20 73 69 64 |ove to other sid| 00000cd0 65 0d 17 de 0e 20 dd f2 6d 6f 76 65 6f 75 74 0d |e.... ..moveout.| 00000ce0 17 df 9a 20 e7 20 28 66 72 65 71 61 3c 33 30 20 |... . (freqa<30 | 00000cf0 84 20 66 72 65 71 62 3c 33 30 20 84 20 66 72 65 |. freqb<30 . fre| 00000d00 71 63 3c 33 30 29 20 84 20 28 72 65 76 69 6e 67 |qc<30) . (reving| 00000d10 20 80 20 28 66 72 65 71 61 3c 31 32 35 20 84 20 | . (freqa<125 . | 00000d20 66 72 65 71 62 3c 31 32 35 20 84 20 66 72 65 71 |freqb<125 . freq| 00000d30 63 3c 31 32 35 29 29 20 8c 20 73 65 61 72 63 68 |c<125)) . search| 00000d40 69 6e 67 3d 73 65 61 72 63 68 69 6e 67 2f 32 3a |ing=searching/2:| 00000d50 72 65 76 69 6e 67 3d b9 3a 72 65 76 65 72 73 65 |reving=.:reverse| 00000d60 3d b9 3a 66 77 64 3d a3 3a 6c 65 66 74 3d a3 3a |=.:fwd=.:left=.:| 00000d70 72 69 67 68 74 3d a3 3a e1 0d 17 e0 0d 20 72 65 |right=.:..... re| 00000d80 76 69 6e 67 3d a3 0d 17 e1 2e 20 e7 20 66 72 65 |ving=..... . fre| 00000d90 71 62 3c 34 30 20 80 20 66 72 65 71 61 3e 32 35 |qb<40 . freqa>25| 00000da0 30 20 8c 20 72 69 67 68 74 3d b9 3a 6e 65 61 72 |0 . right=.:near| 00000db0 3d 31 3a e1 0d 17 e2 34 20 e7 20 66 72 65 71 61 |=1:....4 . freqa| 00000dc0 3c 32 30 30 20 80 20 66 72 65 71 62 3c 32 30 30 |<200 . freqb<200| 00000dd0 20 80 20 66 72 65 71 63 3c 32 30 30 20 8c 20 72 | . freqc<200 . r| 00000de0 69 67 68 74 3d b9 3a e1 0d 17 e3 1f 20 e7 20 6e |ight=.:..... . n| 00000df0 65 61 72 3c 3e 30 20 8c 20 f2 64 6f 6e 65 61 72 |ear<>0 . .donear| 00000e00 73 74 75 66 66 3a e1 0d 17 e8 38 20 e7 20 28 66 |stuff:....8 . (f| 00000e10 72 65 71 62 2a 31 2e 35 29 3c 66 72 65 71 63 20 |reqb*1.5)<freqc | 00000e20 80 20 28 66 72 65 71 61 2a 31 2e 35 29 3c 66 72 |. (freqa*1.5)<fr| 00000e30 65 71 63 20 8c 20 72 69 67 68 74 3d b9 3a e1 0d |eqc . right=.:..| 00000e40 17 f2 23 20 e7 20 28 66 72 65 71 62 2a 31 2e 35 |..# . (freqb*1.5| 00000e50 29 3e 66 72 65 71 63 20 8c 20 6c 65 66 74 3d b9 |)>freqc . left=.| 00000e60 3a e1 0d 18 38 06 20 e1 0d 18 3d 06 20 3a 0d 18 |:...8. ...=. :..| 00000e70 42 47 20 f4 20 4e 65 61 72 6c 79 20 74 68 65 72 |BG . Nearly ther| 00000e80 65 2e 2e 2e 20 4a 75 73 74 20 6e 65 65 64 20 61 |e... Just need a| 00000e90 20 6c 69 74 74 6c 65 20 6e 75 64 67 65 20 69 6e | little nudge in| 00000ea0 20 74 68 65 20 72 69 67 68 74 20 64 69 72 65 63 | the right direc| 00000eb0 74 69 6f 6e 2e 0d 18 43 12 20 dd f2 64 6f 6e 65 |tion...C. ..done| 00000ec0 61 72 73 74 75 66 66 0d 18 44 10 20 6e 65 61 72 |arstuff..D. near| 00000ed0 3d 6e 65 61 72 2b 31 0d 18 45 19 20 e7 20 6e 65 |=near+1..E. . ne| 00000ee0 61 72 3c 34 20 8c 20 72 69 67 68 74 3d b9 3a e1 |ar<4 . right=.:.| 00000ef0 0d 18 46 0b 20 6c 65 66 74 3d b9 0d 18 47 24 20 |..F. left=...G$ | 00000f00 e7 20 6e 65 61 72 3e 37 20 8c 20 6e 65 61 72 3d |. near>7 . near=| 00000f10 30 3a 73 74 61 67 65 3d 73 74 61 67 65 2b 31 0d |0:stage=stage+1.| 00000f20 18 48 06 20 e1 0d 18 49 06 20 3a 0d 18 4c 0e 20 |.H. ...I. :..L. | 00000f30 dd f2 73 65 74 75 70 62 62 0d 18 56 3f 20 72 65 |..setupbb..V? re| 00000f40 76 69 6e 67 3d a3 3a 6c 65 66 74 3d a3 3a 72 69 |ving=.:left=.:ri| 00000f50 67 68 74 3d a3 3a 66 77 64 3d a3 3a 72 65 76 65 |ght=.:fwd=.:reve| 00000f60 72 73 65 3d a3 3a 73 65 61 72 63 68 69 6e 67 3d |rse=.:searching=| 00000f70 30 3a 69 64 6c 65 3d b9 0d 18 5b 0b 20 6e 65 61 |0:idle=...[. nea| 00000f80 72 3d a3 0d 18 60 06 20 e1 0d 18 6a 06 20 3a 0d |r=...`. ...j. :.| 00000f90 18 74 0f 20 dd f2 72 65 6c 65 61 73 65 62 0d 18 |.t. ..releaseb..| 00000fa0 7e 2d 20 f4 20 47 6f 74 20 61 6c 6c 20 74 68 65 |~- . Got all the| 00000fb0 20 62 61 6c 6c 73 2c 20 6e 6f 77 20 6a 75 73 74 | balls, now just| 00000fc0 20 64 75 6d 70 20 74 68 65 6d 21 0d 18 88 20 20 | dump them!... | 00000fd0 6e 65 61 72 3d 6e 65 61 72 2b 31 3a 72 65 76 65 |near=near+1:reve| 00000fe0 72 73 65 3d b9 3a 66 77 64 3d a3 0d 18 92 1d 20 |rse=.:fwd=..... | 00000ff0 e7 20 6e 65 61 72 3e 39 20 8c 20 69 64 6c 65 3d |. near>9 . idle=| 00001000 b9 3a 6e 65 61 72 3d a3 0d 18 9c 06 20 e1 0d 4e |.:near=..... ..N| 00001010 20 44 20 f5 3a e3 58 3d 31 b8 31 32 3a ff 22 43 | D .:.X=1.12:."C| 00001020 48 41 4e 4e 45 4c 56 4f 49 43 45 20 31 20 22 2b |HANNELVOICE 1 "+| 00001030 c3 58 3a d4 31 2c 2d 31 30 2c 35 32 2c 31 30 30 |.X:.1,-10,52,100| 00001040 3a e3 52 3d 30 b8 31 30 30 30 30 3a ed 2c 3a fd |:.R=0.10000:.,:.| 00001050 20 a3 0d ff | ...| 00001054