Home » Personal collection » Acorn hard disk » files » DomFord » RoughWork/Video1

RoughWork/Video1

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

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

Tape/disk: Home » Personal collection » Acorn hard disk » files » DomFord
Filename: RoughWork/Video1
Read OK:
File size: 1755 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM SpriteTest - Interquartile range
   20REM By Dominic Ford - May 1995
   30:
   40MODE 0
   50PRINT"Sprite Recognition by D Ford"'
   60PROCinit
   70PROCanalyse
   80PROCconclusion
   90PROClearn
  100PROCstore
  110MODE 0
  120END
  130:
  140DEFPROCanalyse
  150FOR X=0 TO xax-1
  160FOR Y=0 TO yax-1
  170SYS "OS_SpriteOp",41,,SPR$,X,Y TO ,,,,,C,T
  180bin=0
  190c%(C)=c%(C)+1
  200FORbo=0TObm
  210IF col(bo)=C AND block(bo,X)>Y-6 THEN bin=bin+1:oproc=bo:PROCobject_add
  220NEXT
  230IF bin=0 THEN PROCobject_make
  240IF bin>1 THEN PROCobject_join
  250NEXT,
  260PROCmcc
  270ENDPROC
  280:
  290DEFPROCmcc
  300CM=0:MCC=0:MCC$="White":CMB=0
  310FORC=1TO15
  320C$=CNA$(C)
  330FORs=0TO15
  340IFc%(s)>=CM%(s)THENPOSITION=s
  350NEXT
  360FORs=1TOPOSITION
  370MCC%(s-1)=MCC%(s)
  380CM%(s-1)=CM%(s)
  390MCC$(s-1)=MCC$(s)
  400NEXT
  410MCC%(POSITION)=C
  420CM%(POSITION)=c%(C)
  430MCC$(POSITION)=C$
  440NEXT
  450ENDPROC
  460:
  470DEFPROCinit
  480ON ERROR MODE 0:REPORT:PRINT" at line ";ERL:END
  490SYS "OS_ChangeDynamicArea",3,&8000
  500INPUT"              Server name";NAME$
  510REMOSCLI"I AM "+NAME$
  520INPUT"         Sprite file name";SFILE$
  530INPUT"              Sprite name";SPR$
  540maxno=50
  550PRINT'"Please Wait. . ."
  560OSCLI "SLOAD "+SFILE$
  570SYS "OS_SpriteOp",40,,SPR$ TO ,,,xax,yax,H,,MDOE
  580DIMblock(maxno,xax),col(maxno),bmin(maxno,xax),CNA$(15),cols(15)
  590DIMc%(15),MCC$(15),MCC%(15),CM%(15),iw%(xax)
  600bm=0
  610FOR C=0 TO 15
  620READ CNA$(C),cols(C)
  630NEXT
  640ENDPROC
  650:
  660DEFPROCobject_make
  670IF bm=maxno THEN PRINT'"I am going to need more objects."
  680bm=bm+1
  690col(bm)=C
  700FOR Xwr=X-5 TO X+5
  710IFXwr<0ORXwr>xax THENNEXT:ENDPROC
  720block(bm,Xwr)=Y
  730bmin(bm,Xwr)=Y
  740NEXT
  750ENDPROC
  760:
  770DEFPROCobject_add
  780FOR Xwr=X-5 TO X+5
  790IFXwr<0ORXwr>xax THENNEXT:ENDPROC
  800block(bm,Xwr)=Y
  810IF bmin(bm,Xwr)=0 THEN bmin(bm,Xwr)=Y
  820NEXT
  830ENDPROC
  840:
  850DEFPROCobject_join
  860FOR ob=0 TO bm
  870IF col(ob)=C AND block(ob,X)>=Y-5 THEN PROCadditon
  880NEXT
  890FOR ob=0 TO bm
  900IF col(ob)=C AND ob<>oproc AND block(ob,X)>=Y-5 THEN PROCgetridofit
  910NEXT:oproc=-1
  920ENDPROC
  930:
  940DEFPROCadditon
  950IF oproc=-1 THEN oproc=ob
  960FORxscan=0TOxax-1
  970IF block(ob,xscan)>block(oproc,xscan) THEN block(oproc,xscan)=block(ob,xscan)
  980IF bmin(ob,xscan)<bmin(oproc,xscan) THEN bmin(oproc,xscan)=bmin(ob,xscan)
  990NEXT
 1000ENDPROC
 1010:
 1020DEFPROCgetridofit
 1030FOR groi=ob+1 TO bm
 1040FOR groil=0 TO xax-1
 1050block(groi,groil)=block(groi-1,groil)
 1060bmin(groi,groil)=bmin(groi-1,groil)
 1070NEXT
 1080col(groi)=col(groi-1)
 1090NEXT
 1100bm=bm-1
 1110ENDPROC
 1120:
 1130DEFPROCgetdata
 1140file=OPENIN "<Obey$Dir>.Objects"
 1150INPUT#file,noobs%
 1160DIMob%(noobs%+2,maxno),prob%(noobs%+2,maxno),coobs%(noobs%+2,maxno),name$(noobs%+2),mb(noobs%+2)
 1170FOR obget=0 TO noobs%
 1180INPUT#file,name$(obget),mb(obget)
 1190FOR oblop=1 TO mb(obget)
 1200INPUT#file,ob%(obget,oblop),coobs%(obget,oblop),prob%(obget,oblop)
 1210NEXT,
 1220CLOSE#file
 1230ENDPROC
 1240:
 1250DEFPROCsavedata
 1260file=OPENOUT "<Obey$Dir>.Objects"
 1270PRINT#file,noobs%
 1280FOR obget=0 TO noobs%
 1290PRINT#file,name$(obget),mb(obdata)
 1300FOR oblop=1 TO mb(obdata)
 1310PRINT#file,ob%(obget,oblop),coobs%(obget,oblop),prob%(obget,oblop)
 1320NEXT,
 1330CLOSE#file
 1340ENDPROC
 1350:
 1360DEFPROCconclusion
 1370PROCgetdata
 1380PROCcolcheck
 1390PROCiqrcheck
 1400smax=0
 1410FOR obscan=0 TO noobs%
 1420IF smax<score%(obscan) THEN snum=obscan:smax=score%(obscan):obname$=name$(obscan)
 1430NEXT
 1440ENDPROC
 1450:
 1460DEFPROCcolcheck
 1470DIMscore%(noobs%+2)
 1480FOR picobs=0 TO mb
 1490FOR cclude=0 TO noobs%
 1500FOR obscan=0 TO mb(cclude)
 1510IF(coobs%(cclude,obscan) AND 2^(col(picobs)+1))<>0 THEN score%(cclude)=score%(cclude)+prob%(cclude,obscan)
 1520NEXT,,
 1530ENDPROC
 1540:
 1550DEFPROCiqrcheck
 1560FOR picobs=0 TO mb
 1570iqr=FNiqr(picobs)
 1580FOR cclude=0 TO noobs%
 1590FOR obscan=0 TO mb(cclude)
 1600score%(cclude)=score%(cclude)+prob%(cclude,obscan)*(iqr-ob%(cclude,obscan))*SGN(iqr-ob%(cclude,obscan))
 1610NEXT,,
 1620ENDPROC
 1630:
 1640DEFPROCbonds
 1650FOR cclude=0 TO mb(snum)
 1660FOR learn=0 TO mb
 1670del=FALSE
 1680REPEAT
 1690prob%(snum,cclude)=prob%(snum,cclude)+FNpup
 1700IF prob%(snum,cclude)<=0 THEN PROCgetrid:del=TRUE
 1710UNTIL del=FALSE OR cclude=mb(snum)
 1720NEXT,
 1730ENDPROC
 1740:
 1750DEFPROClearn
 1760PRINT'"Is it a ";obname$;:PROCask
 1770IF A$="N" THEN INPUT"What was it then";obname$:PROCrethink
 1780PRINT'"Was it a ";MCC$;" ";obname$;:PROCask
 1790IF A$="N" THEN PROCrecolour
 1800PROCbonds
 1810ENDPROC
 1820:
 1830DEFPROCrecolour
 1840PROCcolourtable
 1850REPEAT
 1860A$=GET$
 1870UNTIL ASC(A$)>64 AND ASC(A$)<70
 1880MCC%=ASC(A$)-64
 1890MCC$=CNA$(MCC%)
 1900ENDPROC
 1910:
 1920DEFPROCcolourtable
 1930MODE MDOE
 1940*<Obey$Dir>.!Palette
 1950PRINT"What colour was it then:"
 1960FORc=0TO15
 1970COLOUR 128:PRINTCHR$(c+64);" ";
 1980COLOUR c+128
 1990PRINT;"          ";
 2000NEXT
 2010ENDPROC
 2020:
 2030DEFPROCrethink
 2040PROCbonds
 2050REPEAT
 2060err=FALSE
 2070obname$=" "+obname$+" "
 2080FOR c=2 TO LEN(obname$)-1
 2090IF FNrt<97 THEN obname$=LEFT$(obname$,c-1)+CHR$(FNrt+32)+RIGHT$(obname$,LEN(obname$)-c+1)
 2100IF FNrt<97 OR FNrt>122 THEN err=TRUE
 2110NEXT
 2120IF err=TRUE THEN PROCreask
 2130UNTIL err=FALSE
 2140FOR ono=0 TO noobs%
 2150IF name$(ono)=obname$ THEN snum=ono
 2160ENDPROC
 2170:
 2180DEFPROCreask
 2190PRINT'"Object names can only contain letters. Please re-type the name"'
 2200INPUT"What was it then";obname$
 2210ENDPROC
 2220:
 2230DEFPROCnewob
 2240noobs%=noobs%+1
 2250mb(noobs%)=mb
 2260name$(noobs%)=obname$
 2270FOR ono=0 TO mb
 2280ob%(noobs%,ono)=FNiqr(ono)
 2290coobs%(noobs%,ono)=cols(col(ono))
 2300prob%(noobs%,ono)=2
 2310NEXT
 2320ENDPROC
 2330:
 2340DEFPROCask
 2350PRINT;" (Y/N) ";
 2360REPEAT
 2370A$=GET$
 2380UNTIL A$="Y" OR A$="N"
 2390IF A$="Y" THEN PRINT"Yes" ELSE PRINT"No"
 2400ENDPROC
 2410:
 2420DEFPROCgetrid
 2430mb(snum)=mb(snum)-1
 2440FOR obno=cclude TO mb(snum)
 2450ob%(obno,snum)=ob%(obno+1,snum)
 2460coobs%(obno,snum)=coobs%(obno+1,snum)
 2470prob%(obno,snum)=prob%(obno+1,snum)
 2480NEXT
 2490ENDPROC
 2500:
 2510DEFPROCstore
 2520MODE MDOE
 2530PLOT &ED,0,0
 2540PRINT"Do you want me to learn from this sprite";:PROCask
 2550IF A$="N" THEN ENDPROC
 2560PRINT"Please wait. . .";
 2570PROCsavedata
 2580ENDPROC
 2590:
 2600DEFFNiqr(ono)
 2610dva=-1
 2620FOR xt=0 TO xax-1
 2630IF block(ono,xt)>bmin(ono,xt) THEN PROCaddiqr
 2640NEXT
 2650=iw%(INT(dva*.75))/iw%(INT(dva*.25))
 2660:
 2670DEFPROCaddiqr
 2680dva=dva+1
 2690FOR xs=0 TO dva
 2700IFFNdif>=iw%(xs)THENPOSITION=s
 2710NEXT
 2720FORs=1TOPOSITION
 2730iw%(xs-1)=iw%(xs)
 2740NEXT
 2750iw%(dva)=FNdif
 2760ENDPROC
 2770:
 2780DEFFNdif=block(ono,xt)-bmin(ono,xt)
 2790:
 2800DEFFNpup
 2810xs=0
 2820FOR ono=0 TO mb
 2830iqr=FNiqr(ono)
 2840IF iqr<=obs%(snum,cclude) THEN xt=(iqr/obs%(snum,cclude))*1.5
 2850IF iqr>obs%(snum,cclude) THEN xt=(obs%(snum,cclude)/iqr)*1.5
 2860IF (2^(col(ono)+1) AND coob%(snum,cclude)) THEN xt=xt+.25
 2870IF col(ono)=MCC% THEN xt=xt+.25
 2880IF xt>xs THEN xs=xt
 2890NEXT
 2900=xs-1
 2910:
 2920DEFFNrt=ASC(MID$(obname$,c,1))
 2930:
 2940DATA "white",3,"light grey",7,"medium grey",14,"dark grey",28,"very dark grey",240
 2950DATA "extremely dark grey",240,"light black",240,"black",240
 2960DATA "dark blue",8448,"yellow",4608,"green",1024,"red",18432
 2970DATA "light yellow",4608,"dark green",8448
 2980DATA "orange",16384,"light blue",32768

&� SpriteTest - Interquartile range
 � By Dominic Ford - May 1995
:
(� 0
2$�"Sprite Recognition by D Ford"'
<	�init
F�analyse
P�conclusion
Z
�learn
d
�store
n� 0
x�
�:
�
��analyse
�� X=0 � xax-1
�� Y=0 � yax-1
�,ș "OS_SpriteOp",41,,SPR$,X,Y � ,,,,,C,T
�	bin=0
�c%(C)=c%(C)+1
��bo=0�bm
�B� col(bo)=C � block(bo,X)>Y-6 � bin=bin+1:oproc=bo:�object_add
��
�� bin=0 � �object_make
�� bin>1 � �object_join
��,
�mcc
�
:
"	��mcc
,!CM=0:MCC=0:MCC$="White":CMB=0
6�C=1�15
@C$=CNA$(C)
J�s=0�15
T�c%(s)>=CM%(s)�POSITION=s
^�
h�s=1�POSITION
rMCC%(s-1)=MCC%(s)
|CM%(s-1)=CM%(s)
�MCC$(s-1)=MCC$(s)
��
�MCC%(POSITION)=C
�CM%(POSITION)=c%(C)
�MCC$(POSITION)=C$
��
��
�:
�
��init
�� � � 0:�:�" at line ";�:�
�%ș "OS_ChangeDynamicArea",3,&8000
�&�"              Server name";NAME$
��OSCLI"I AM "+NAME$
'�"         Sprite file name";SFILE$
%�"              Sprite name";SPR$
maxno=50
&�'"Please Wait. . ."
0� "SLOAD "+SFILE$
:2ș "OS_SpriteOp",40,,SPR$ � ,,,xax,yax,H,,MDOE
DB�block(maxno,xax),col(maxno),bmin(maxno,xax),CNA$(15),cols(15)
N.�c%(15),MCC$(15),MCC%(15),CM%(15),iw%(xax)
Xbm=0
b� C=0 � 15
l� CNA$(C),cols(C)
v�
��
�:
���object_make
�5� bm=maxno � �'"I am going to need more objects."
�bm=bm+1
�
col(bm)=C
�� Xwr=X-5 � X+5
��Xwr<0�Xwr>xax ��:�
�block(bm,Xwr)=Y
�bmin(bm,Xwr)=Y
��
��
�:
��object_add
� Xwr=X-5 � X+5
�Xwr<0�Xwr>xax ��:�
 block(bm,Xwr)=Y
*%� bmin(bm,Xwr)=0 � bmin(bm,Xwr)=Y
4�
>�
H:
R��object_join
\� ob=0 � bm
f-� col(ob)=C � block(ob,X)>=Y-5 � �additon
p�
z� ob=0 � bm
�<� col(ob)=C � ob<>oproc � block(ob,X)>=Y-5 � �getridofit
��:oproc=-1
��
�:
�
��additon
�� oproc=-1 � oproc=ob
��xscan=0�xax-1
�M� block(ob,xscan)>block(oproc,xscan) � block(oproc,xscan)=block(ob,xscan)
�I� bmin(ob,xscan)<bmin(oproc,xscan) � bmin(oproc,xscan)=bmin(ob,xscan)
��
��
�:
���getridofit
� groi=ob+1 � bm
� groil=0 � xax-1
)block(groi,groil)=block(groi-1,groil)
$'bmin(groi,groil)=bmin(groi-1,groil)
.�
8col(groi)=col(groi-1)
B�
Lbm=bm-1
V�
`:
j
��getdata
tfile=� "<Obey$Dir>.Objects"
~�#file,noobs%
�b�ob%(noobs%+2,maxno),prob%(noobs%+2,maxno),coobs%(noobs%+2,maxno),name$(noobs%+2),mb(noobs%+2)
�� obget=0 � noobs%
�!�#file,name$(obget),mb(obget)
�� oblop=1 � mb(obget)
�B�#file,ob%(obget,oblop),coobs%(obget,oblop),prob%(obget,oblop)
��,
�
�#file
��
�:
���savedata
�file=� "<Obey$Dir>.Objects"
��#file,noobs%
� obget=0 � noobs%

"�#file,name$(obget),mb(obdata)
� oblop=1 � mb(obdata)
B�#file,ob%(obget,oblop),coobs%(obget,oblop),prob%(obget,oblop)
(�,
2
�#file
<�
F:
P��conclusion
Z�getdata
d
�colcheck
n
�iqrcheck
x
smax=0
�� obscan=0 � noobs%
�Q� smax<score%(obscan) � snum=obscan:smax=score%(obscan):obname$=name$(obscan)
��
��
�:
���colcheck
��score%(noobs%+2)
�� picobs=0 � mb
�� cclude=0 � noobs%
�� obscan=0 � mb(cclude)
�h�(coobs%(cclude,obscan) � 2^(col(picobs)+1))<>0 � score%(cclude)=score%(cclude)+prob%(cclude,obscan)
��,,
��
:
��iqrcheck
� picobs=0 � mb
"iqr=�iqr(picobs)
,� cclude=0 � noobs%
6� obscan=0 � mb(cclude)
@iscore%(cclude)=score%(cclude)+prob%(cclude,obscan)*(iqr-ob%(cclude,obscan))*�(iqr-ob%(cclude,obscan))
J�,,
T�
^:
h��bonds
r� cclude=0 � mb(snum)
|� learn=0 � mb
�	del=�
��
�.prob%(snum,cclude)=prob%(snum,cclude)+�pup
�+� prob%(snum,cclude)<=0 � �getrid:del=�
�� del=� � cclude=mb(snum)
��,
��
�:
���learn
��'"Is it a ";obname$;:�ask
�3� A$="N" � �"What was it then";obname$:�rethink
�(�'"Was it a ";MCC$;" ";obname$;:�ask
�� A$="N" � �recolour

�bonds
�
:
&��recolour
0�colourtable
:�
DA$=�
N� �(A$)>64 � �(A$)<70
XMCC%=�(A$)-64
bMCC$=CNA$(MCC%)
l�
v:
���colourtable
�
� MDOE
�*<Obey$Dir>.!Palette
��"What colour was it then:"
��c=0�15
�� 128:�(c+64);" ";
�� c+128
��;"          ";
��
��
�:
�
��rethink
�
�bonds
�
	err=�
obname$=" "+obname$+" "
 � c=2 � �(obname$)-1
*G� �rt<97 � obname$=�obname$,c-1)+�(�rt+32)+�obname$,�(obname$)-c+1)
4� �rt<97 � �rt>122 � err=�
>�
H� err=� � �reask
R� err=�
\� ono=0 � noobs%
f#� name$(ono)=obname$ � snum=ono
p�
z:
���reask
�G�'"Object names can only contain letters. Please re-type the name"'
��"What was it then";obname$
��
�:
���newob
�noobs%=noobs%+1
�mb(noobs%)=mb
�name$(noobs%)=obname$
�� ono=0 � mb
�ob%(noobs%,ono)=�iqr(ono)
�%coobs%(noobs%,ono)=cols(col(ono))
�prob%(noobs%,ono)=2
	�
	�
	:
	$	��ask
	.�;" (Y/N) ";
	8�
	BA$=�
	L� A$="Y" � A$="N"
	V� A$="Y" � �"Yes" � �"No"
	`�
	j:
	t��getrid
	~mb(snum)=mb(snum)-1
	�� obno=cclude � mb(snum)
	�#ob%(obno,snum)=ob%(obno+1,snum)
	�)coobs%(obno,snum)=coobs%(obno+1,snum)
	�'prob%(obno,snum)=prob%(obno+1,snum)
	��
	��
	�:
	���store
	�
� MDOE
	�
� &ED,0,0
	�5�"Do you want me to learn from this sprite";:�ask
	�� A$="N" � �
�"Please wait. . .";


�savedata
�
:
(ݤiqr(ono)
2
dva=-1
<� xt=0 � xax-1
F*� block(ono,xt)>bmin(ono,xt) � �addiqr
P�
Z$=iw%(�(dva*.75))/iw%(�(dva*.25))
d:
n��addiqr
x
dva=dva+1
�� xs=0 � dva
��dif>=iw%(xs)�POSITION=s
��
��s=1�POSITION
�iw%(xs-1)=iw%(xs)
��
�iw%(dva)=�dif
��
�:
�$ݤdif=block(ono,xt)-bmin(ono,xt)
�:
�	ݤpup
�xs=0
� ono=0 � mb
iqr=�iqr(ono)
=� iqr<=obs%(snum,cclude) � xt=(iqr/obs%(snum,cclude))*1.5
"<� iqr>obs%(snum,cclude) � xt=(obs%(snum,cclude)/iqr)*1.5
,7� (2^(col(ono)+1) � coob%(snum,cclude)) � xt=xt+.25
6� col(ono)=MCC% � xt=xt+.25
@� xt>xs � xs=xt
J�
T	=xs-1
^:
hݤrt=�(�obname$,c,1))
r:
|S� "white",3,"light grey",7,"medium grey",14,"dark grey",28,"very dark grey",240
�=� "extremely dark grey",240,"light black",240,"black",240
�=� "dark blue",8448,"yellow",4608,"green",1024,"red",18432
�+� "light yellow",4608,"dark green",8448
�'� "orange",16384,"light blue",32768
�
00000000  0d 00 0a 26 f4 20 53 70  72 69 74 65 54 65 73 74  |...&. SpriteTest|
00000010  20 2d 20 49 6e 74 65 72  71 75 61 72 74 69 6c 65  | - Interquartile|
00000020  20 72 61 6e 67 65 0d 00  14 20 f4 20 42 79 20 44  | range... . By D|
00000030  6f 6d 69 6e 69 63 20 46  6f 72 64 20 2d 20 4d 61  |ominic Ford - Ma|
00000040  79 20 31 39 39 35 0d 00  1e 05 3a 0d 00 28 07 eb  |y 1995....:..(..|
00000050  20 30 0d 00 32 24 f1 22  53 70 72 69 74 65 20 52  | 0..2$."Sprite R|
00000060  65 63 6f 67 6e 69 74 69  6f 6e 20 62 79 20 44 20  |ecognition by D |
00000070  46 6f 72 64 22 27 0d 00  3c 09 f2 69 6e 69 74 0d  |Ford"'..<..init.|
00000080  00 46 0c f2 61 6e 61 6c  79 73 65 0d 00 50 0f f2  |.F..analyse..P..|
00000090  63 6f 6e 63 6c 75 73 69  6f 6e 0d 00 5a 0a f2 6c  |conclusion..Z..l|
000000a0  65 61 72 6e 0d 00 64 0a  f2 73 74 6f 72 65 0d 00  |earn..d..store..|
000000b0  6e 07 eb 20 30 0d 00 78  05 e0 0d 00 82 05 3a 0d  |n.. 0..x......:.|
000000c0  00 8c 0d dd f2 61 6e 61  6c 79 73 65 0d 00 96 11  |.....analyse....|
000000d0  e3 20 58 3d 30 20 b8 20  78 61 78 2d 31 0d 00 a0  |. X=0 . xax-1...|
000000e0  11 e3 20 59 3d 30 20 b8  20 79 61 78 2d 31 0d 00  |.. Y=0 . yax-1..|
000000f0  aa 2c c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |.,.. "OS_SpriteO|
00000100  70 22 2c 34 31 2c 2c 53  50 52 24 2c 58 2c 59 20  |p",41,,SPR$,X,Y |
00000110  b8 20 2c 2c 2c 2c 2c 43  2c 54 0d 00 b4 09 62 69  |. ,,,,,C,T....bi|
00000120  6e 3d 30 0d 00 be 11 63  25 28 43 29 3d 63 25 28  |n=0....c%(C)=c%(|
00000130  43 29 2b 31 0d 00 c8 0c  e3 62 6f 3d 30 b8 62 6d  |C)+1.....bo=0.bm|
00000140  0d 00 d2 42 e7 20 63 6f  6c 28 62 6f 29 3d 43 20  |...B. col(bo)=C |
00000150  80 20 62 6c 6f 63 6b 28  62 6f 2c 58 29 3e 59 2d  |. block(bo,X)>Y-|
00000160  36 20 8c 20 62 69 6e 3d  62 69 6e 2b 31 3a 6f 70  |6 . bin=bin+1:op|
00000170  72 6f 63 3d 62 6f 3a f2  6f 62 6a 65 63 74 5f 61  |roc=bo:.object_a|
00000180  64 64 0d 00 dc 05 ed 0d  00 e6 1a e7 20 62 69 6e  |dd.......... bin|
00000190  3d 30 20 8c 20 f2 6f 62  6a 65 63 74 5f 6d 61 6b  |=0 . .object_mak|
000001a0  65 0d 00 f0 1a e7 20 62  69 6e 3e 31 20 8c 20 f2  |e..... bin>1 . .|
000001b0  6f 62 6a 65 63 74 5f 6a  6f 69 6e 0d 00 fa 06 ed  |object_join.....|
000001c0  2c 0d 01 04 08 f2 6d 63  63 0d 01 0e 05 e1 0d 01  |,.....mcc.......|
000001d0  18 05 3a 0d 01 22 09 dd  f2 6d 63 63 0d 01 2c 21  |..:.."...mcc..,!|
000001e0  43 4d 3d 30 3a 4d 43 43  3d 30 3a 4d 43 43 24 3d  |CM=0:MCC=0:MCC$=|
000001f0  22 57 68 69 74 65 22 3a  43 4d 42 3d 30 0d 01 36  |"White":CMB=0..6|
00000200  0b e3 43 3d 31 b8 31 35  0d 01 40 0e 43 24 3d 43  |..C=1.15..@.C$=C|
00000210  4e 41 24 28 43 29 0d 01  4a 0b e3 73 3d 30 b8 31  |NA$(C)..J..s=0.1|
00000220  35 0d 01 54 1d e7 63 25  28 73 29 3e 3d 43 4d 25  |5..T..c%(s)>=CM%|
00000230  28 73 29 8c 50 4f 53 49  54 49 4f 4e 3d 73 0d 01  |(s).POSITION=s..|
00000240  5e 05 ed 0d 01 68 11 e3  73 3d 31 b8 50 4f 53 49  |^....h..s=1.POSI|
00000250  54 49 4f 4e 0d 01 72 15  4d 43 43 25 28 73 2d 31  |TION..r.MCC%(s-1|
00000260  29 3d 4d 43 43 25 28 73  29 0d 01 7c 13 43 4d 25  |)=MCC%(s)..|.CM%|
00000270  28 73 2d 31 29 3d 43 4d  25 28 73 29 0d 01 86 15  |(s-1)=CM%(s)....|
00000280  4d 43 43 24 28 73 2d 31  29 3d 4d 43 43 24 28 73  |MCC$(s-1)=MCC$(s|
00000290  29 0d 01 90 05 ed 0d 01  9a 14 4d 43 43 25 28 50  |).........MCC%(P|
000002a0  4f 53 49 54 49 4f 4e 29  3d 43 0d 01 a4 17 43 4d  |OSITION)=C....CM|
000002b0  25 28 50 4f 53 49 54 49  4f 4e 29 3d 63 25 28 43  |%(POSITION)=c%(C|
000002c0  29 0d 01 ae 15 4d 43 43  24 28 50 4f 53 49 54 49  |)....MCC$(POSITI|
000002d0  4f 4e 29 3d 43 24 0d 01  b8 05 ed 0d 01 c2 05 e1  |ON)=C$..........|
000002e0  0d 01 cc 05 3a 0d 01 d6  0a dd f2 69 6e 69 74 0d  |....:......init.|
000002f0  01 e0 1e ee 20 85 20 eb  20 30 3a f6 3a f1 22 20  |.... . . 0:.:." |
00000300  61 74 20 6c 69 6e 65 20  22 3b 9e 3a e0 0d 01 ea  |at line ";.:....|
00000310  25 c8 99 20 22 4f 53 5f  43 68 61 6e 67 65 44 79  |%.. "OS_ChangeDy|
00000320  6e 61 6d 69 63 41 72 65  61 22 2c 33 2c 26 38 30  |namicArea",3,&80|
00000330  30 30 0d 01 f4 26 e8 22  20 20 20 20 20 20 20 20  |00...&."        |
00000340  20 20 20 20 20 20 53 65  72 76 65 72 20 6e 61 6d  |      Server nam|
00000350  65 22 3b 4e 41 4d 45 24  0d 01 fe 17 f4 4f 53 43  |e";NAME$.....OSC|
00000360  4c 49 22 49 20 41 4d 20  22 2b 4e 41 4d 45 24 0d  |LI"I AM "+NAME$.|
00000370  02 08 27 e8 22 20 20 20  20 20 20 20 20 20 53 70  |..'."         Sp|
00000380  72 69 74 65 20 66 69 6c  65 20 6e 61 6d 65 22 3b  |rite file name";|
00000390  53 46 49 4c 45 24 0d 02  12 25 e8 22 20 20 20 20  |SFILE$...%."    |
000003a0  20 20 20 20 20 20 20 20  20 20 53 70 72 69 74 65  |          Sprite|
000003b0  20 6e 61 6d 65 22 3b 53  50 52 24 0d 02 1c 0c 6d  | name";SPR$....m|
000003c0  61 78 6e 6f 3d 35 30 0d  02 26 18 f1 27 22 50 6c  |axno=50..&..'"Pl|
000003d0  65 61 73 65 20 57 61 69  74 2e 20 2e 20 2e 22 0d  |ease Wait. . .".|
000003e0  02 30 15 ff 20 22 53 4c  4f 41 44 20 22 2b 53 46  |.0.. "SLOAD "+SF|
000003f0  49 4c 45 24 0d 02 3a 32  c8 99 20 22 4f 53 5f 53  |ILE$..:2.. "OS_S|
00000400  70 72 69 74 65 4f 70 22  2c 34 30 2c 2c 53 50 52  |priteOp",40,,SPR|
00000410  24 20 b8 20 2c 2c 2c 78  61 78 2c 79 61 78 2c 48  |$ . ,,,xax,yax,H|
00000420  2c 2c 4d 44 4f 45 0d 02  44 42 de 62 6c 6f 63 6b  |,,MDOE..DB.block|
00000430  28 6d 61 78 6e 6f 2c 78  61 78 29 2c 63 6f 6c 28  |(maxno,xax),col(|
00000440  6d 61 78 6e 6f 29 2c 62  6d 69 6e 28 6d 61 78 6e  |maxno),bmin(maxn|
00000450  6f 2c 78 61 78 29 2c 43  4e 41 24 28 31 35 29 2c  |o,xax),CNA$(15),|
00000460  63 6f 6c 73 28 31 35 29  0d 02 4e 2e de 63 25 28  |cols(15)..N..c%(|
00000470  31 35 29 2c 4d 43 43 24  28 31 35 29 2c 4d 43 43  |15),MCC$(15),MCC|
00000480  25 28 31 35 29 2c 43 4d  25 28 31 35 29 2c 69 77  |%(15),CM%(15),iw|
00000490  25 28 78 61 78 29 0d 02  58 08 62 6d 3d 30 0d 02  |%(xax)..X.bm=0..|
000004a0  62 0e e3 20 43 3d 30 20  b8 20 31 35 0d 02 6c 15  |b.. C=0 . 15..l.|
000004b0  f3 20 43 4e 41 24 28 43  29 2c 63 6f 6c 73 28 43  |. CNA$(C),cols(C|
000004c0  29 0d 02 76 05 ed 0d 02  80 05 e1 0d 02 8a 05 3a  |)..v...........:|
000004d0  0d 02 94 11 dd f2 6f 62  6a 65 63 74 5f 6d 61 6b  |......object_mak|
000004e0  65 0d 02 9e 35 e7 20 62  6d 3d 6d 61 78 6e 6f 20  |e...5. bm=maxno |
000004f0  8c 20 f1 27 22 49 20 61  6d 20 67 6f 69 6e 67 20  |. .'"I am going |
00000500  74 6f 20 6e 65 65 64 20  6d 6f 72 65 20 6f 62 6a  |to need more obj|
00000510  65 63 74 73 2e 22 0d 02  a8 0b 62 6d 3d 62 6d 2b  |ects."....bm=bm+|
00000520  31 0d 02 b2 0d 63 6f 6c  28 62 6d 29 3d 43 0d 02  |1....col(bm)=C..|
00000530  bc 13 e3 20 58 77 72 3d  58 2d 35 20 b8 20 58 2b  |... Xwr=X-5 . X+|
00000540  35 0d 02 c6 17 e7 58 77  72 3c 30 84 58 77 72 3e  |5.....Xwr<0.Xwr>|
00000550  78 61 78 20 8c ed 3a e1  0d 02 d0 13 62 6c 6f 63  |xax ..:.....bloc|
00000560  6b 28 62 6d 2c 58 77 72  29 3d 59 0d 02 da 12 62  |k(bm,Xwr)=Y....b|
00000570  6d 69 6e 28 62 6d 2c 58  77 72 29 3d 59 0d 02 e4  |min(bm,Xwr)=Y...|
00000580  05 ed 0d 02 ee 05 e1 0d  02 f8 05 3a 0d 03 02 10  |...........:....|
00000590  dd f2 6f 62 6a 65 63 74  5f 61 64 64 0d 03 0c 13  |..object_add....|
000005a0  e3 20 58 77 72 3d 58 2d  35 20 b8 20 58 2b 35 0d  |. Xwr=X-5 . X+5.|
000005b0  03 16 17 e7 58 77 72 3c  30 84 58 77 72 3e 78 61  |....Xwr<0.Xwr>xa|
000005c0  78 20 8c ed 3a e1 0d 03  20 13 62 6c 6f 63 6b 28  |x ..:... .block(|
000005d0  62 6d 2c 58 77 72 29 3d  59 0d 03 2a 25 e7 20 62  |bm,Xwr)=Y..*%. b|
000005e0  6d 69 6e 28 62 6d 2c 58  77 72 29 3d 30 20 8c 20  |min(bm,Xwr)=0 . |
000005f0  62 6d 69 6e 28 62 6d 2c  58 77 72 29 3d 59 0d 03  |bmin(bm,Xwr)=Y..|
00000600  34 05 ed 0d 03 3e 05 e1  0d 03 48 05 3a 0d 03 52  |4....>....H.:..R|
00000610  11 dd f2 6f 62 6a 65 63  74 5f 6a 6f 69 6e 0d 03  |...object_join..|
00000620  5c 0f e3 20 6f 62 3d 30  20 b8 20 62 6d 0d 03 66  |\.. ob=0 . bm..f|
00000630  2d e7 20 63 6f 6c 28 6f  62 29 3d 43 20 80 20 62  |-. col(ob)=C . b|
00000640  6c 6f 63 6b 28 6f 62 2c  58 29 3e 3d 59 2d 35 20  |lock(ob,X)>=Y-5 |
00000650  8c 20 f2 61 64 64 69 74  6f 6e 0d 03 70 05 ed 0d  |. .additon..p...|
00000660  03 7a 0f e3 20 6f 62 3d  30 20 b8 20 62 6d 0d 03  |.z.. ob=0 . bm..|
00000670  84 3c e7 20 63 6f 6c 28  6f 62 29 3d 43 20 80 20  |.<. col(ob)=C . |
00000680  6f 62 3c 3e 6f 70 72 6f  63 20 80 20 62 6c 6f 63  |ob<>oproc . bloc|
00000690  6b 28 6f 62 2c 58 29 3e  3d 59 2d 35 20 8c 20 f2  |k(ob,X)>=Y-5 . .|
000006a0  67 65 74 72 69 64 6f 66  69 74 0d 03 8e 0e ed 3a  |getridofit.....:|
000006b0  6f 70 72 6f 63 3d 2d 31  0d 03 98 05 e1 0d 03 a2  |oproc=-1........|
000006c0  05 3a 0d 03 ac 0d dd f2  61 64 64 69 74 6f 6e 0d  |.:......additon.|
000006d0  03 b6 19 e7 20 6f 70 72  6f 63 3d 2d 31 20 8c 20  |.... oproc=-1 . |
000006e0  6f 70 72 6f 63 3d 6f 62  0d 03 c0 12 e3 78 73 63  |oproc=ob.....xsc|
000006f0  61 6e 3d 30 b8 78 61 78  2d 31 0d 03 ca 4d e7 20  |an=0.xax-1...M. |
00000700  62 6c 6f 63 6b 28 6f 62  2c 78 73 63 61 6e 29 3e  |block(ob,xscan)>|
00000710  62 6c 6f 63 6b 28 6f 70  72 6f 63 2c 78 73 63 61  |block(oproc,xsca|
00000720  6e 29 20 8c 20 62 6c 6f  63 6b 28 6f 70 72 6f 63  |n) . block(oproc|
00000730  2c 78 73 63 61 6e 29 3d  62 6c 6f 63 6b 28 6f 62  |,xscan)=block(ob|
00000740  2c 78 73 63 61 6e 29 0d  03 d4 49 e7 20 62 6d 69  |,xscan)...I. bmi|
00000750  6e 28 6f 62 2c 78 73 63  61 6e 29 3c 62 6d 69 6e  |n(ob,xscan)<bmin|
00000760  28 6f 70 72 6f 63 2c 78  73 63 61 6e 29 20 8c 20  |(oproc,xscan) . |
00000770  62 6d 69 6e 28 6f 70 72  6f 63 2c 78 73 63 61 6e  |bmin(oproc,xscan|
00000780  29 3d 62 6d 69 6e 28 6f  62 2c 78 73 63 61 6e 29  |)=bmin(ob,xscan)|
00000790  0d 03 de 05 ed 0d 03 e8  05 e1 0d 03 f2 05 3a 0d  |..............:.|
000007a0  03 fc 10 dd f2 67 65 74  72 69 64 6f 66 69 74 0d  |.....getridofit.|
000007b0  04 06 14 e3 20 67 72 6f  69 3d 6f 62 2b 31 20 b8  |.... groi=ob+1 .|
000007c0  20 62 6d 0d 04 10 15 e3  20 67 72 6f 69 6c 3d 30  | bm..... groil=0|
000007d0  20 b8 20 78 61 78 2d 31  0d 04 1a 29 62 6c 6f 63  | . xax-1...)bloc|
000007e0  6b 28 67 72 6f 69 2c 67  72 6f 69 6c 29 3d 62 6c  |k(groi,groil)=bl|
000007f0  6f 63 6b 28 67 72 6f 69  2d 31 2c 67 72 6f 69 6c  |ock(groi-1,groil|
00000800  29 0d 04 24 27 62 6d 69  6e 28 67 72 6f 69 2c 67  |)..$'bmin(groi,g|
00000810  72 6f 69 6c 29 3d 62 6d  69 6e 28 67 72 6f 69 2d  |roil)=bmin(groi-|
00000820  31 2c 67 72 6f 69 6c 29  0d 04 2e 05 ed 0d 04 38  |1,groil).......8|
00000830  19 63 6f 6c 28 67 72 6f  69 29 3d 63 6f 6c 28 67  |.col(groi)=col(g|
00000840  72 6f 69 2d 31 29 0d 04  42 05 ed 0d 04 4c 0b 62  |roi-1)..B....L.b|
00000850  6d 3d 62 6d 2d 31 0d 04  56 05 e1 0d 04 60 05 3a  |m=bm-1..V....`.:|
00000860  0d 04 6a 0d dd f2 67 65  74 64 61 74 61 0d 04 74  |..j...getdata..t|
00000870  1f 66 69 6c 65 3d 8e 20  22 3c 4f 62 65 79 24 44  |.file=. "<Obey$D|
00000880  69 72 3e 2e 4f 62 6a 65  63 74 73 22 0d 04 7e 11  |ir>.Objects"..~.|
00000890  e8 23 66 69 6c 65 2c 6e  6f 6f 62 73 25 0d 04 88  |.#file,noobs%...|
000008a0  62 de 6f 62 25 28 6e 6f  6f 62 73 25 2b 32 2c 6d  |b.ob%(noobs%+2,m|
000008b0  61 78 6e 6f 29 2c 70 72  6f 62 25 28 6e 6f 6f 62  |axno),prob%(noob|
000008c0  73 25 2b 32 2c 6d 61 78  6e 6f 29 2c 63 6f 6f 62  |s%+2,maxno),coob|
000008d0  73 25 28 6e 6f 6f 62 73  25 2b 32 2c 6d 61 78 6e  |s%(noobs%+2,maxn|
000008e0  6f 29 2c 6e 61 6d 65 24  28 6e 6f 6f 62 73 25 2b  |o),name$(noobs%+|
000008f0  32 29 2c 6d 62 28 6e 6f  6f 62 73 25 2b 32 29 0d  |2),mb(noobs%+2).|
00000900  04 92 16 e3 20 6f 62 67  65 74 3d 30 20 b8 20 6e  |.... obget=0 . n|
00000910  6f 6f 62 73 25 0d 04 9c  21 e8 23 66 69 6c 65 2c  |oobs%...!.#file,|
00000920  6e 61 6d 65 24 28 6f 62  67 65 74 29 2c 6d 62 28  |name$(obget),mb(|
00000930  6f 62 67 65 74 29 0d 04  a6 19 e3 20 6f 62 6c 6f  |obget)..... oblo|
00000940  70 3d 31 20 b8 20 6d 62  28 6f 62 67 65 74 29 0d  |p=1 . mb(obget).|
00000950  04 b0 42 e8 23 66 69 6c  65 2c 6f 62 25 28 6f 62  |..B.#file,ob%(ob|
00000960  67 65 74 2c 6f 62 6c 6f  70 29 2c 63 6f 6f 62 73  |get,oblop),coobs|
00000970  25 28 6f 62 67 65 74 2c  6f 62 6c 6f 70 29 2c 70  |%(obget,oblop),p|
00000980  72 6f 62 25 28 6f 62 67  65 74 2c 6f 62 6c 6f 70  |rob%(obget,oblop|
00000990  29 0d 04 ba 06 ed 2c 0d  04 c4 0a d9 23 66 69 6c  |).....,.....#fil|
000009a0  65 0d 04 ce 05 e1 0d 04  d8 05 3a 0d 04 e2 0e dd  |e.........:.....|
000009b0  f2 73 61 76 65 64 61 74  61 0d 04 ec 1f 66 69 6c  |.savedata....fil|
000009c0  65 3d ae 20 22 3c 4f 62  65 79 24 44 69 72 3e 2e  |e=. "<Obey$Dir>.|
000009d0  4f 62 6a 65 63 74 73 22  0d 04 f6 11 f1 23 66 69  |Objects".....#fi|
000009e0  6c 65 2c 6e 6f 6f 62 73  25 0d 05 00 16 e3 20 6f  |le,noobs%..... o|
000009f0  62 67 65 74 3d 30 20 b8  20 6e 6f 6f 62 73 25 0d  |bget=0 . noobs%.|
00000a00  05 0a 22 f1 23 66 69 6c  65 2c 6e 61 6d 65 24 28  |..".#file,name$(|
00000a10  6f 62 67 65 74 29 2c 6d  62 28 6f 62 64 61 74 61  |obget),mb(obdata|
00000a20  29 0d 05 14 1a e3 20 6f  62 6c 6f 70 3d 31 20 b8  |)..... oblop=1 .|
00000a30  20 6d 62 28 6f 62 64 61  74 61 29 0d 05 1e 42 f1  | mb(obdata)...B.|
00000a40  23 66 69 6c 65 2c 6f 62  25 28 6f 62 67 65 74 2c  |#file,ob%(obget,|
00000a50  6f 62 6c 6f 70 29 2c 63  6f 6f 62 73 25 28 6f 62  |oblop),coobs%(ob|
00000a60  67 65 74 2c 6f 62 6c 6f  70 29 2c 70 72 6f 62 25  |get,oblop),prob%|
00000a70  28 6f 62 67 65 74 2c 6f  62 6c 6f 70 29 0d 05 28  |(obget,oblop)..(|
00000a80  06 ed 2c 0d 05 32 0a d9  23 66 69 6c 65 0d 05 3c  |..,..2..#file..<|
00000a90  05 e1 0d 05 46 05 3a 0d  05 50 10 dd f2 63 6f 6e  |....F.:..P...con|
00000aa0  63 6c 75 73 69 6f 6e 0d  05 5a 0c f2 67 65 74 64  |clusion..Z..getd|
00000ab0  61 74 61 0d 05 64 0d f2  63 6f 6c 63 68 65 63 6b  |ata..d..colcheck|
00000ac0  0d 05 6e 0d f2 69 71 72  63 68 65 63 6b 0d 05 78  |..n..iqrcheck..x|
00000ad0  0a 73 6d 61 78 3d 30 0d  05 82 17 e3 20 6f 62 73  |.smax=0..... obs|
00000ae0  63 61 6e 3d 30 20 b8 20  6e 6f 6f 62 73 25 0d 05  |can=0 . noobs%..|
00000af0  8c 51 e7 20 73 6d 61 78  3c 73 63 6f 72 65 25 28  |.Q. smax<score%(|
00000b00  6f 62 73 63 61 6e 29 20  8c 20 73 6e 75 6d 3d 6f  |obscan) . snum=o|
00000b10  62 73 63 61 6e 3a 73 6d  61 78 3d 73 63 6f 72 65  |bscan:smax=score|
00000b20  25 28 6f 62 73 63 61 6e  29 3a 6f 62 6e 61 6d 65  |%(obscan):obname|
00000b30  24 3d 6e 61 6d 65 24 28  6f 62 73 63 61 6e 29 0d  |$=name$(obscan).|
00000b40  05 96 05 ed 0d 05 a0 05  e1 0d 05 aa 05 3a 0d 05  |.............:..|
00000b50  b4 0e dd f2 63 6f 6c 63  68 65 63 6b 0d 05 be 15  |....colcheck....|
00000b60  de 73 63 6f 72 65 25 28  6e 6f 6f 62 73 25 2b 32  |.score%(noobs%+2|
00000b70  29 0d 05 c8 13 e3 20 70  69 63 6f 62 73 3d 30 20  |)..... picobs=0 |
00000b80  b8 20 6d 62 0d 05 d2 17  e3 20 63 63 6c 75 64 65  |. mb..... cclude|
00000b90  3d 30 20 b8 20 6e 6f 6f  62 73 25 0d 05 dc 1b e3  |=0 . noobs%.....|
00000ba0  20 6f 62 73 63 61 6e 3d  30 20 b8 20 6d 62 28 63  | obscan=0 . mb(c|
00000bb0  63 6c 75 64 65 29 0d 05  e6 68 e7 28 63 6f 6f 62  |clude)...h.(coob|
00000bc0  73 25 28 63 63 6c 75 64  65 2c 6f 62 73 63 61 6e  |s%(cclude,obscan|
00000bd0  29 20 80 20 32 5e 28 63  6f 6c 28 70 69 63 6f 62  |) . 2^(col(picob|
00000be0  73 29 2b 31 29 29 3c 3e  30 20 8c 20 73 63 6f 72  |s)+1))<>0 . scor|
00000bf0  65 25 28 63 63 6c 75 64  65 29 3d 73 63 6f 72 65  |e%(cclude)=score|
00000c00  25 28 63 63 6c 75 64 65  29 2b 70 72 6f 62 25 28  |%(cclude)+prob%(|
00000c10  63 63 6c 75 64 65 2c 6f  62 73 63 61 6e 29 0d 05  |cclude,obscan)..|
00000c20  f0 07 ed 2c 2c 0d 05 fa  05 e1 0d 06 04 05 3a 0d  |...,,.........:.|
00000c30  06 0e 0e dd f2 69 71 72  63 68 65 63 6b 0d 06 18  |.....iqrcheck...|
00000c40  13 e3 20 70 69 63 6f 62  73 3d 30 20 b8 20 6d 62  |.. picobs=0 . mb|
00000c50  0d 06 22 14 69 71 72 3d  a4 69 71 72 28 70 69 63  |..".iqr=.iqr(pic|
00000c60  6f 62 73 29 0d 06 2c 17  e3 20 63 63 6c 75 64 65  |obs)..,.. cclude|
00000c70  3d 30 20 b8 20 6e 6f 6f  62 73 25 0d 06 36 1b e3  |=0 . noobs%..6..|
00000c80  20 6f 62 73 63 61 6e 3d  30 20 b8 20 6d 62 28 63  | obscan=0 . mb(c|
00000c90  63 6c 75 64 65 29 0d 06  40 69 73 63 6f 72 65 25  |clude)..@iscore%|
00000ca0  28 63 63 6c 75 64 65 29  3d 73 63 6f 72 65 25 28  |(cclude)=score%(|
00000cb0  63 63 6c 75 64 65 29 2b  70 72 6f 62 25 28 63 63  |cclude)+prob%(cc|
00000cc0  6c 75 64 65 2c 6f 62 73  63 61 6e 29 2a 28 69 71  |lude,obscan)*(iq|
00000cd0  72 2d 6f 62 25 28 63 63  6c 75 64 65 2c 6f 62 73  |r-ob%(cclude,obs|
00000ce0  63 61 6e 29 29 2a b4 28  69 71 72 2d 6f 62 25 28  |can))*.(iqr-ob%(|
00000cf0  63 63 6c 75 64 65 2c 6f  62 73 63 61 6e 29 29 0d  |cclude,obscan)).|
00000d00  06 4a 07 ed 2c 2c 0d 06  54 05 e1 0d 06 5e 05 3a  |.J..,,..T....^.:|
00000d10  0d 06 68 0b dd f2 62 6f  6e 64 73 0d 06 72 19 e3  |..h...bonds..r..|
00000d20  20 63 63 6c 75 64 65 3d  30 20 b8 20 6d 62 28 73  | cclude=0 . mb(s|
00000d30  6e 75 6d 29 0d 06 7c 12  e3 20 6c 65 61 72 6e 3d  |num)..|.. learn=|
00000d40  30 20 b8 20 6d 62 0d 06  86 09 64 65 6c 3d a3 0d  |0 . mb....del=..|
00000d50  06 90 05 f5 0d 06 9a 2e  70 72 6f 62 25 28 73 6e  |........prob%(sn|
00000d60  75 6d 2c 63 63 6c 75 64  65 29 3d 70 72 6f 62 25  |um,cclude)=prob%|
00000d70  28 73 6e 75 6d 2c 63 63  6c 75 64 65 29 2b a4 70  |(snum,cclude)+.p|
00000d80  75 70 0d 06 a4 2b e7 20  70 72 6f 62 25 28 73 6e  |up...+. prob%(sn|
00000d90  75 6d 2c 63 63 6c 75 64  65 29 3c 3d 30 20 8c 20  |um,cclude)<=0 . |
00000da0  f2 67 65 74 72 69 64 3a  64 65 6c 3d b9 0d 06 ae  |.getrid:del=....|
00000db0  1d fd 20 64 65 6c 3d a3  20 84 20 63 63 6c 75 64  |.. del=. . cclud|
00000dc0  65 3d 6d 62 28 73 6e 75  6d 29 0d 06 b8 06 ed 2c  |e=mb(snum).....,|
00000dd0  0d 06 c2 05 e1 0d 06 cc  05 3a 0d 06 d6 0b dd f2  |.........:......|
00000de0  6c 65 61 72 6e 0d 06 e0  1e f1 27 22 49 73 20 69  |learn.....'"Is i|
00000df0  74 20 61 20 22 3b 6f 62  6e 61 6d 65 24 3b 3a f2  |t a ";obname$;:.|
00000e00  61 73 6b 0d 06 ea 33 e7  20 41 24 3d 22 4e 22 20  |ask...3. A$="N" |
00000e10  8c 20 e8 22 57 68 61 74  20 77 61 73 20 69 74 20  |. ."What was it |
00000e20  74 68 65 6e 22 3b 6f 62  6e 61 6d 65 24 3a f2 72  |then";obname$:.r|
00000e30  65 74 68 69 6e 6b 0d 06  f4 28 f1 27 22 57 61 73  |ethink...(.'"Was|
00000e40  20 69 74 20 61 20 22 3b  4d 43 43 24 3b 22 20 22  | it a ";MCC$;" "|
00000e50  3b 6f 62 6e 61 6d 65 24  3b 3a f2 61 73 6b 0d 06  |;obname$;:.ask..|
00000e60  fe 18 e7 20 41 24 3d 22  4e 22 20 8c 20 f2 72 65  |... A$="N" . .re|
00000e70  63 6f 6c 6f 75 72 0d 07  08 0a f2 62 6f 6e 64 73  |colour.....bonds|
00000e80  0d 07 12 05 e1 0d 07 1c  05 3a 0d 07 26 0e dd f2  |.........:..&...|
00000e90  72 65 63 6f 6c 6f 75 72  0d 07 30 10 f2 63 6f 6c  |recolour..0..col|
00000ea0  6f 75 72 74 61 62 6c 65  0d 07 3a 05 f5 0d 07 44  |ourtable..:....D|
00000eb0  08 41 24 3d be 0d 07 4e  19 fd 20 97 28 41 24 29  |.A$=...N.. .(A$)|
00000ec0  3e 36 34 20 80 20 97 28  41 24 29 3c 37 30 0d 07  |>64 . .(A$)<70..|
00000ed0  58 11 4d 43 43 25 3d 97  28 41 24 29 2d 36 34 0d  |X.MCC%=.(A$)-64.|
00000ee0  07 62 13 4d 43 43 24 3d  43 4e 41 24 28 4d 43 43  |.b.MCC$=CNA$(MCC|
00000ef0  25 29 0d 07 6c 05 e1 0d  07 76 05 3a 0d 07 80 11  |%)..l....v.:....|
00000f00  dd f2 63 6f 6c 6f 75 72  74 61 62 6c 65 0d 07 8a  |..colourtable...|
00000f10  0a eb 20 4d 44 4f 45 0d  07 94 18 2a 3c 4f 62 65  |.. MDOE....*<Obe|
00000f20  79 24 44 69 72 3e 2e 21  50 61 6c 65 74 74 65 0d  |y$Dir>.!Palette.|
00000f30  07 9e 1f f1 22 57 68 61  74 20 63 6f 6c 6f 75 72  |...."What colour|
00000f40  20 77 61 73 20 69 74 20  74 68 65 6e 3a 22 0d 07  | was it then:"..|
00000f50  a8 0b e3 63 3d 30 b8 31  35 0d 07 b2 17 fb 20 31  |...c=0.15..... 1|
00000f60  32 38 3a f1 bd 28 63 2b  36 34 29 3b 22 20 22 3b  |28:..(c+64);" ";|
00000f70  0d 07 bc 0b fb 20 63 2b  31 32 38 0d 07 c6 13 f1  |..... c+128.....|
00000f80  3b 22 20 20 20 20 20 20  20 20 20 20 22 3b 0d 07  |;"          ";..|
00000f90  d0 05 ed 0d 07 da 05 e1  0d 07 e4 05 3a 0d 07 ee  |............:...|
00000fa0  0d dd f2 72 65 74 68 69  6e 6b 0d 07 f8 0a f2 62  |...rethink.....b|
00000fb0  6f 6e 64 73 0d 08 02 05  f5 0d 08 0c 09 65 72 72  |onds.........err|
00000fc0  3d a3 0d 08 16 1b 6f 62  6e 61 6d 65 24 3d 22 20  |=.....obname$=" |
00000fd0  22 2b 6f 62 6e 61 6d 65  24 2b 22 20 22 0d 08 20  |"+obname$+" ".. |
00000fe0  18 e3 20 63 3d 32 20 b8  20 a9 28 6f 62 6e 61 6d  |.. c=2 . .(obnam|
00000ff0  65 24 29 2d 31 0d 08 2a  47 e7 20 a4 72 74 3c 39  |e$)-1..*G. .rt<9|
00001000  37 20 8c 20 6f 62 6e 61  6d 65 24 3d c0 6f 62 6e  |7 . obname$=.obn|
00001010  61 6d 65 24 2c 63 2d 31  29 2b bd 28 a4 72 74 2b  |ame$,c-1)+.(.rt+|
00001020  33 32 29 2b c2 6f 62 6e  61 6d 65 24 2c a9 28 6f  |32)+.obname$,.(o|
00001030  62 6e 61 6d 65 24 29 2d  63 2b 31 29 0d 08 34 1e  |bname$)-c+1)..4.|
00001040  e7 20 a4 72 74 3c 39 37  20 84 20 a4 72 74 3e 31  |. .rt<97 . .rt>1|
00001050  32 32 20 8c 20 65 72 72  3d b9 0d 08 3e 05 ed 0d  |22 . err=...>...|
00001060  08 48 14 e7 20 65 72 72  3d b9 20 8c 20 f2 72 65  |.H.. err=. . .re|
00001070  61 73 6b 0d 08 52 0b fd  20 65 72 72 3d a3 0d 08  |ask..R.. err=...|
00001080  5c 14 e3 20 6f 6e 6f 3d  30 20 b8 20 6e 6f 6f 62  |\.. ono=0 . noob|
00001090  73 25 0d 08 66 23 e7 20  6e 61 6d 65 24 28 6f 6e  |s%..f#. name$(on|
000010a0  6f 29 3d 6f 62 6e 61 6d  65 24 20 8c 20 73 6e 75  |o)=obname$ . snu|
000010b0  6d 3d 6f 6e 6f 0d 08 70  05 e1 0d 08 7a 05 3a 0d  |m=ono..p....z.:.|
000010c0  08 84 0b dd f2 72 65 61  73 6b 0d 08 8e 47 f1 27  |.....reask...G.'|
000010d0  22 4f 62 6a 65 63 74 20  6e 61 6d 65 73 20 63 61  |"Object names ca|
000010e0  6e 20 6f 6e 6c 79 20 63  6f 6e 74 61 69 6e 20 6c  |n only contain l|
000010f0  65 74 74 65 72 73 2e 20  50 6c 65 61 73 65 20 72  |etters. Please r|
00001100  65 2d 74 79 70 65 20 74  68 65 20 6e 61 6d 65 22  |e-type the name"|
00001110  27 0d 08 98 1f e8 22 57  68 61 74 20 77 61 73 20  |'....."What was |
00001120  69 74 20 74 68 65 6e 22  3b 6f 62 6e 61 6d 65 24  |it then";obname$|
00001130  0d 08 a2 05 e1 0d 08 ac  05 3a 0d 08 b6 0b dd f2  |.........:......|
00001140  6e 65 77 6f 62 0d 08 c0  13 6e 6f 6f 62 73 25 3d  |newob....noobs%=|
00001150  6e 6f 6f 62 73 25 2b 31  0d 08 ca 11 6d 62 28 6e  |noobs%+1....mb(n|
00001160  6f 6f 62 73 25 29 3d 6d  62 0d 08 d4 19 6e 61 6d  |oobs%)=mb....nam|
00001170  65 24 28 6e 6f 6f 62 73  25 29 3d 6f 62 6e 61 6d  |e$(noobs%)=obnam|
00001180  65 24 0d 08 de 10 e3 20  6f 6e 6f 3d 30 20 b8 20  |e$..... ono=0 . |
00001190  6d 62 0d 08 e8 1d 6f 62  25 28 6e 6f 6f 62 73 25  |mb....ob%(noobs%|
000011a0  2c 6f 6e 6f 29 3d a4 69  71 72 28 6f 6e 6f 29 0d  |,ono)=.iqr(ono).|
000011b0  08 f2 25 63 6f 6f 62 73  25 28 6e 6f 6f 62 73 25  |..%coobs%(noobs%|
000011c0  2c 6f 6e 6f 29 3d 63 6f  6c 73 28 63 6f 6c 28 6f  |,ono)=cols(col(o|
000011d0  6e 6f 29 29 0d 08 fc 17  70 72 6f 62 25 28 6e 6f  |no))....prob%(no|
000011e0  6f 62 73 25 2c 6f 6e 6f  29 3d 32 0d 09 06 05 ed  |obs%,ono)=2.....|
000011f0  0d 09 10 05 e1 0d 09 1a  05 3a 0d 09 24 09 dd f2  |.........:..$...|
00001200  61 73 6b 0d 09 2e 10 f1  3b 22 20 28 59 2f 4e 29  |ask.....;" (Y/N)|
00001210  20 22 3b 0d 09 38 05 f5  0d 09 42 08 41 24 3d be  | ";..8....B.A$=.|
00001220  0d 09 4c 15 fd 20 41 24  3d 22 59 22 20 84 20 41  |..L.. A$="Y" . A|
00001230  24 3d 22 4e 22 0d 09 56  1d e7 20 41 24 3d 22 59  |$="N"..V.. A$="Y|
00001240  22 20 8c 20 f1 22 59 65  73 22 20 8b 20 f1 22 4e  |" . ."Yes" . ."N|
00001250  6f 22 0d 09 60 05 e1 0d  09 6a 05 3a 0d 09 74 0c  |o"..`....j.:..t.|
00001260  dd f2 67 65 74 72 69 64  0d 09 7e 17 6d 62 28 73  |..getrid..~.mb(s|
00001270  6e 75 6d 29 3d 6d 62 28  73 6e 75 6d 29 2d 31 0d  |num)=mb(snum)-1.|
00001280  09 88 1c e3 20 6f 62 6e  6f 3d 63 63 6c 75 64 65  |.... obno=cclude|
00001290  20 b8 20 6d 62 28 73 6e  75 6d 29 0d 09 92 23 6f  | . mb(snum)...#o|
000012a0  62 25 28 6f 62 6e 6f 2c  73 6e 75 6d 29 3d 6f 62  |b%(obno,snum)=ob|
000012b0  25 28 6f 62 6e 6f 2b 31  2c 73 6e 75 6d 29 0d 09  |%(obno+1,snum)..|
000012c0  9c 29 63 6f 6f 62 73 25  28 6f 62 6e 6f 2c 73 6e  |.)coobs%(obno,sn|
000012d0  75 6d 29 3d 63 6f 6f 62  73 25 28 6f 62 6e 6f 2b  |um)=coobs%(obno+|
000012e0  31 2c 73 6e 75 6d 29 0d  09 a6 27 70 72 6f 62 25  |1,snum)...'prob%|
000012f0  28 6f 62 6e 6f 2c 73 6e  75 6d 29 3d 70 72 6f 62  |(obno,snum)=prob|
00001300  25 28 6f 62 6e 6f 2b 31  2c 73 6e 75 6d 29 0d 09  |%(obno+1,snum)..|
00001310  b0 05 ed 0d 09 ba 05 e1  0d 09 c4 05 3a 0d 09 ce  |............:...|
00001320  0b dd f2 73 74 6f 72 65  0d 09 d8 0a eb 20 4d 44  |...store..... MD|
00001330  4f 45 0d 09 e2 0d f0 20  26 45 44 2c 30 2c 30 0d  |OE..... &ED,0,0.|
00001340  09 ec 35 f1 22 44 6f 20  79 6f 75 20 77 61 6e 74  |..5."Do you want|
00001350  20 6d 65 20 74 6f 20 6c  65 61 72 6e 20 66 72 6f  | me to learn fro|
00001360  6d 20 74 68 69 73 20 73  70 72 69 74 65 22 3b 3a  |m this sprite";:|
00001370  f2 61 73 6b 0d 09 f6 10  e7 20 41 24 3d 22 4e 22  |.ask..... A$="N"|
00001380  20 8c 20 e1 0d 0a 00 18  f1 22 50 6c 65 61 73 65  | . ......"Please|
00001390  20 77 61 69 74 2e 20 2e  20 2e 22 3b 0d 0a 0a 0d  | wait. . .";....|
000013a0  f2 73 61 76 65 64 61 74  61 0d 0a 14 05 e1 0d 0a  |.savedata.......|
000013b0  1e 05 3a 0d 0a 28 0e dd  a4 69 71 72 28 6f 6e 6f  |..:..(...iqr(ono|
000013c0  29 0d 0a 32 0a 64 76 61  3d 2d 31 0d 0a 3c 12 e3  |)..2.dva=-1..<..|
000013d0  20 78 74 3d 30 20 b8 20  78 61 78 2d 31 0d 0a 46  | xt=0 . xax-1..F|
000013e0  2a e7 20 62 6c 6f 63 6b  28 6f 6e 6f 2c 78 74 29  |*. block(ono,xt)|
000013f0  3e 62 6d 69 6e 28 6f 6e  6f 2c 78 74 29 20 8c 20  |>bmin(ono,xt) . |
00001400  f2 61 64 64 69 71 72 0d  0a 50 05 ed 0d 0a 5a 24  |.addiqr..P....Z$|
00001410  3d 69 77 25 28 a8 28 64  76 61 2a 2e 37 35 29 29  |=iw%(.(dva*.75))|
00001420  2f 69 77 25 28 a8 28 64  76 61 2a 2e 32 35 29 29  |/iw%(.(dva*.25))|
00001430  0d 0a 64 05 3a 0d 0a 6e  0c dd f2 61 64 64 69 71  |..d.:..n...addiq|
00001440  72 0d 0a 78 0d 64 76 61  3d 64 76 61 2b 31 0d 0a  |r..x.dva=dva+1..|
00001450  82 10 e3 20 78 73 3d 30  20 b8 20 64 76 61 0d 0a  |... xs=0 . dva..|
00001460  8c 1d e7 a4 64 69 66 3e  3d 69 77 25 28 78 73 29  |....dif>=iw%(xs)|
00001470  8c 50 4f 53 49 54 49 4f  4e 3d 73 0d 0a 96 05 ed  |.POSITION=s.....|
00001480  0d 0a a0 11 e3 73 3d 31  b8 50 4f 53 49 54 49 4f  |.....s=1.POSITIO|
00001490  4e 0d 0a aa 15 69 77 25  28 78 73 2d 31 29 3d 69  |N....iw%(xs-1)=i|
000014a0  77 25 28 78 73 29 0d 0a  b4 05 ed 0d 0a be 11 69  |w%(xs).........i|
000014b0  77 25 28 64 76 61 29 3d  a4 64 69 66 0d 0a c8 05  |w%(dva)=.dif....|
000014c0  e1 0d 0a d2 05 3a 0d 0a  dc 24 dd a4 64 69 66 3d  |.....:...$..dif=|
000014d0  62 6c 6f 63 6b 28 6f 6e  6f 2c 78 74 29 2d 62 6d  |block(ono,xt)-bm|
000014e0  69 6e 28 6f 6e 6f 2c 78  74 29 0d 0a e6 05 3a 0d  |in(ono,xt)....:.|
000014f0  0a f0 09 dd a4 70 75 70  0d 0a fa 08 78 73 3d 30  |.....pup....xs=0|
00001500  0d 0b 04 10 e3 20 6f 6e  6f 3d 30 20 b8 20 6d 62  |..... ono=0 . mb|
00001510  0d 0b 0e 11 69 71 72 3d  a4 69 71 72 28 6f 6e 6f  |....iqr=.iqr(ono|
00001520  29 0d 0b 18 3d e7 20 69  71 72 3c 3d 6f 62 73 25  |)...=. iqr<=obs%|
00001530  28 73 6e 75 6d 2c 63 63  6c 75 64 65 29 20 8c 20  |(snum,cclude) . |
00001540  78 74 3d 28 69 71 72 2f  6f 62 73 25 28 73 6e 75  |xt=(iqr/obs%(snu|
00001550  6d 2c 63 63 6c 75 64 65  29 29 2a 31 2e 35 0d 0b  |m,cclude))*1.5..|
00001560  22 3c e7 20 69 71 72 3e  6f 62 73 25 28 73 6e 75  |"<. iqr>obs%(snu|
00001570  6d 2c 63 63 6c 75 64 65  29 20 8c 20 78 74 3d 28  |m,cclude) . xt=(|
00001580  6f 62 73 25 28 73 6e 75  6d 2c 63 63 6c 75 64 65  |obs%(snum,cclude|
00001590  29 2f 69 71 72 29 2a 31  2e 35 0d 0b 2c 37 e7 20  |)/iqr)*1.5..,7. |
000015a0  28 32 5e 28 63 6f 6c 28  6f 6e 6f 29 2b 31 29 20  |(2^(col(ono)+1) |
000015b0  80 20 63 6f 6f 62 25 28  73 6e 75 6d 2c 63 63 6c  |. coob%(snum,ccl|
000015c0  75 64 65 29 29 20 8c 20  78 74 3d 78 74 2b 2e 32  |ude)) . xt=xt+.2|
000015d0  35 0d 0b 36 1f e7 20 63  6f 6c 28 6f 6e 6f 29 3d  |5..6.. col(ono)=|
000015e0  4d 43 43 25 20 8c 20 78  74 3d 78 74 2b 2e 32 35  |MCC% . xt=xt+.25|
000015f0  0d 0b 40 13 e7 20 78 74  3e 78 73 20 8c 20 78 73  |..@.. xt>xs . xs|
00001600  3d 78 74 0d 0b 4a 05 ed  0d 0b 54 09 3d 78 73 2d  |=xt..J....T.=xs-|
00001610  31 0d 0b 5e 05 3a 0d 0b  68 19 dd a4 72 74 3d 97  |1..^.:..h...rt=.|
00001620  28 c1 6f 62 6e 61 6d 65  24 2c 63 2c 31 29 29 0d  |(.obname$,c,1)).|
00001630  0b 72 05 3a 0d 0b 7c 53  dc 20 22 77 68 69 74 65  |.r.:..|S. "white|
00001640  22 2c 33 2c 22 6c 69 67  68 74 20 67 72 65 79 22  |",3,"light grey"|
00001650  2c 37 2c 22 6d 65 64 69  75 6d 20 67 72 65 79 22  |,7,"medium grey"|
00001660  2c 31 34 2c 22 64 61 72  6b 20 67 72 65 79 22 2c  |,14,"dark grey",|
00001670  32 38 2c 22 76 65 72 79  20 64 61 72 6b 20 67 72  |28,"very dark gr|
00001680  65 79 22 2c 32 34 30 0d  0b 86 3d dc 20 22 65 78  |ey",240...=. "ex|
00001690  74 72 65 6d 65 6c 79 20  64 61 72 6b 20 67 72 65  |tremely dark gre|
000016a0  79 22 2c 32 34 30 2c 22  6c 69 67 68 74 20 62 6c  |y",240,"light bl|
000016b0  61 63 6b 22 2c 32 34 30  2c 22 62 6c 61 63 6b 22  |ack",240,"black"|
000016c0  2c 32 34 30 0d 0b 90 3d  dc 20 22 64 61 72 6b 20  |,240...=. "dark |
000016d0  62 6c 75 65 22 2c 38 34  34 38 2c 22 79 65 6c 6c  |blue",8448,"yell|
000016e0  6f 77 22 2c 34 36 30 38  2c 22 67 72 65 65 6e 22  |ow",4608,"green"|
000016f0  2c 31 30 32 34 2c 22 72  65 64 22 2c 31 38 34 33  |,1024,"red",1843|
00001700  32 0d 0b 9a 2b dc 20 22  6c 69 67 68 74 20 79 65  |2...+. "light ye|
00001710  6c 6c 6f 77 22 2c 34 36  30 38 2c 22 64 61 72 6b  |llow",4608,"dark|
00001720  20 67 72 65 65 6e 22 2c  38 34 34 38 0d 0b a4 27  | green",8448...'|
00001730  dc 20 22 6f 72 61 6e 67  65 22 2c 31 36 33 38 34  |. "orange",16384|
00001740  2c 22 6c 69 67 68 74 20  62 6c 75 65 22 2c 33 32  |,"light blue",32|
00001750  37 36 38 0d ff                                    |768..|
00001755