Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2 » StarInfo/Cooke/BallPack27

StarInfo/Cooke/BallPack27

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2
Filename: StarInfo/Cooke/BallPack27
Read OK:
File size: 0337 bytes
Load address: 0000
Exec address: 0000
File contents
   10MODE 27:OFF
   20FOR i=0 TO 15
   30 COLOUR i,i*17,i*17,i*17
   40NEXT
   50most=150
   60
   70min=16
   80max=128
   90
  100DIM x(most),y(most),r(most),c(most)
  110SYS "OS_SWINumberFromString",,"ColourTrans_SetGCOL" TO gcol
  120n=0
  130REPEAT
  140 REPEAT
  150  x=RND(1280)
  160  y=RND(960)
  170  r=FNrad(x,y)
  180 UNTIL r>min
  190 CIRCLE FILL x,y,r
  200 x(n)=x
  210 y(n)=y
  220 r(n)=r
  230 c(n)=r
  240 n+=1
  250UNTIL n>most
  260CLS
  270FOR i=0 TO most-1
  280r(i)=r(i)*1.5
  290c(i)=c(i)*1.5
  300NEXT
  310m=max*1.5
  320togo=most
  330REPEAT
  340 FOR i=0 TO most-1
  350  IF r(i)>0 THEN
  360  c=(c(i)-r(i))*255/c(i)
  370  SYS gcol, (c<<24) OR (c<<16) OR (c<<8),,,256
  380  CIRCLE FILL x(i),y(i),r(i)
  390  r(i)=r(i)-2
  400  IF r(i)<=0 togo-=1
  410  ENDIF
  420 NEXT
  430UNTIL togo=0
  440IFGET
  450END
  460
  470DEF FNrad(x,y)
  480IF n>0 THEN
  490 FOR r=min TO max
  500  FOR i=0 TO n-1
  510   d=SQR((x-x(i))^2 + (y-y(i))^2)
  520   IF d < r+r(i) THEN =d-r(i)-1
  530  NEXT
  540 NEXT
  550ENDIF
  560=min+RND(max-min)


� 27:�
� i=0 � 15
 � i,i*17,i*17,i*17
(�
2most=150
<
F
min=16
Pmax=128
Z
d%� x(most),y(most),r(most),c(most)
n=ș "OS_SWINumberFromString",,"ColourTrans_SetGCOL" � gcol
xn=0
��
� �
�  x=�(1280)
�  y=�(960)
�  r=�rad(x,y)
� � r>min
� ȏ Ȑ x,y,r
� x(n)=x
� y(n)=y
� r(n)=r
� c(n)=r
�	 n+=1
�� n>most
�
� i=0 � most-1
r(i)=r(i)*1.5
"c(i)=c(i)*1.5
,�
6
m=max*1.5
@
togo=most
J�
T � i=0 � most-1
^  � r(i)>0 �
h  c=(c(i)-r(i))*255/c(i)
r/  ș gcol, (c<<24) � (c<<16) � (c<<8),,,256
|  ȏ Ȑ x(i),y(i),r(i)
�  r(i)=r(i)-2
�  � r(i)<=0 togo-=1
�  �
� �
�� togo=0
��
��
�
�� �rad(x,y)
�� n>0 �
� � r=min � max
�  � i=0 � n-1
�#   d=�((x-x(i))^2 + (y-y(i))^2)
   � d < r+r(i) � =d-r(i)-1
  �
 �
&�
0=min+�(max-min)
�
00000000  0d 00 0a 0a eb 20 32 37  3a 87 0d 00 14 0e e3 20  |..... 27:...... |
00000010  69 3d 30 20 b8 20 31 35  0d 00 1e 17 20 fb 20 69  |i=0 . 15.... . i|
00000020  2c 69 2a 31 37 2c 69 2a  31 37 2c 69 2a 31 37 0d  |,i*17,i*17,i*17.|
00000030  00 28 05 ed 0d 00 32 0c  6d 6f 73 74 3d 31 35 30  |.(....2.most=150|
00000040  0d 00 3c 04 0d 00 46 0a  6d 69 6e 3d 31 36 0d 00  |..<...F.min=16..|
00000050  50 0b 6d 61 78 3d 31 32  38 0d 00 5a 04 0d 00 64  |P.max=128..Z...d|
00000060  25 de 20 78 28 6d 6f 73  74 29 2c 79 28 6d 6f 73  |%. x(most),y(mos|
00000070  74 29 2c 72 28 6d 6f 73  74 29 2c 63 28 6d 6f 73  |t),r(most),c(mos|
00000080  74 29 0d 00 6e 3d c8 99  20 22 4f 53 5f 53 57 49  |t)..n=.. "OS_SWI|
00000090  4e 75 6d 62 65 72 46 72  6f 6d 53 74 72 69 6e 67  |NumberFromString|
000000a0  22 2c 2c 22 43 6f 6c 6f  75 72 54 72 61 6e 73 5f  |",,"ColourTrans_|
000000b0  53 65 74 47 43 4f 4c 22  20 b8 20 67 63 6f 6c 0d  |SetGCOL" . gcol.|
000000c0  00 78 07 6e 3d 30 0d 00  82 05 f5 0d 00 8c 06 20  |.x.n=0......... |
000000d0  f5 0d 00 96 0f 20 20 78  3d b3 28 31 32 38 30 29  |.....  x=.(1280)|
000000e0  0d 00 a0 0e 20 20 79 3d  b3 28 39 36 30 29 0d 00  |....  y=.(960)..|
000000f0  aa 11 20 20 72 3d a4 72  61 64 28 78 2c 79 29 0d  |..  r=.rad(x,y).|
00000100  00 b4 0c 20 fd 20 72 3e  6d 69 6e 0d 00 be 10 20  |... . r>min.... |
00000110  c8 8f 20 c8 90 20 78 2c  79 2c 72 0d 00 c8 0b 20  |.. .. x,y,r.... |
00000120  78 28 6e 29 3d 78 0d 00  d2 0b 20 79 28 6e 29 3d  |x(n)=x.... y(n)=|
00000130  79 0d 00 dc 0b 20 72 28  6e 29 3d 72 0d 00 e6 0b  |y.... r(n)=r....|
00000140  20 63 28 6e 29 3d 72 0d  00 f0 09 20 6e 2b 3d 31  | c(n)=r.... n+=1|
00000150  0d 00 fa 0c fd 20 6e 3e  6d 6f 73 74 0d 01 04 05  |..... n>most....|
00000160  db 0d 01 0e 12 e3 20 69  3d 30 20 b8 20 6d 6f 73  |...... i=0 . mos|
00000170  74 2d 31 0d 01 18 11 72  28 69 29 3d 72 28 69 29  |t-1....r(i)=r(i)|
00000180  2a 31 2e 35 0d 01 22 11  63 28 69 29 3d 63 28 69  |*1.5..".c(i)=c(i|
00000190  29 2a 31 2e 35 0d 01 2c  05 ed 0d 01 36 0d 6d 3d  |)*1.5..,....6.m=|
000001a0  6d 61 78 2a 31 2e 35 0d  01 40 0d 74 6f 67 6f 3d  |max*1.5..@.togo=|
000001b0  6d 6f 73 74 0d 01 4a 05  f5 0d 01 54 13 20 e3 20  |most..J....T. . |
000001c0  69 3d 30 20 b8 20 6d 6f  73 74 2d 31 0d 01 5e 10  |i=0 . most-1..^.|
000001d0  20 20 e7 20 72 28 69 29  3e 30 20 8c 0d 01 68 1c  |  . r(i)>0 ...h.|
000001e0  20 20 63 3d 28 63 28 69  29 2d 72 28 69 29 29 2a  |  c=(c(i)-r(i))*|
000001f0  32 35 35 2f 63 28 69 29  0d 01 72 2f 20 20 c8 99  |255/c(i)..r/  ..|
00000200  20 67 63 6f 6c 2c 20 28  63 3c 3c 32 34 29 20 84  | gcol, (c<<24) .|
00000210  20 28 63 3c 3c 31 36 29  20 84 20 28 63 3c 3c 38  | (c<<16) . (c<<8|
00000220  29 2c 2c 2c 32 35 36 0d  01 7c 1a 20 20 c8 8f 20  |),,,256..|.  .. |
00000230  c8 90 20 78 28 69 29 2c  79 28 69 29 2c 72 28 69  |.. x(i),y(i),r(i|
00000240  29 0d 01 86 11 20 20 72  28 69 29 3d 72 28 69 29  |)....  r(i)=r(i)|
00000250  2d 32 0d 01 90 17 20 20  e7 20 72 28 69 29 3c 3d  |-2....  . r(i)<=|
00000260  30 20 74 6f 67 6f 2d 3d  31 0d 01 9a 07 20 20 cd  |0 togo-=1....  .|
00000270  0d 01 a4 06 20 ed 0d 01  ae 0c fd 20 74 6f 67 6f  |.... ...... togo|
00000280  3d 30 0d 01 b8 06 e7 a5  0d 01 c2 05 e0 0d 01 cc  |=0..............|
00000290  04 0d 01 d6 0f dd 20 a4  72 61 64 28 78 2c 79 29  |...... .rad(x,y)|
000002a0  0d 01 e0 0b e7 20 6e 3e  30 20 8c 0d 01 ea 12 20  |..... n>0 ..... |
000002b0  e3 20 72 3d 6d 69 6e 20  b8 20 6d 61 78 0d 01 f4  |. r=min . max...|
000002c0  11 20 20 e3 20 69 3d 30  20 b8 20 6e 2d 31 0d 01  |.  . i=0 . n-1..|
000002d0  fe 23 20 20 20 64 3d b6  28 28 78 2d 78 28 69 29  |.#   d=.((x-x(i)|
000002e0  29 5e 32 20 2b 20 28 79  2d 79 28 69 29 29 5e 32  |)^2 + (y-y(i))^2|
000002f0  29 0d 02 08 1f 20 20 20  e7 20 64 20 3c 20 72 2b  |)....   . d < r+|
00000300  72 28 69 29 20 8c 20 3d  64 2d 72 28 69 29 2d 31  |r(i) . =d-r(i)-1|
00000310  0d 02 12 07 20 20 ed 0d  02 1c 06 20 ed 0d 02 26  |....  ..... ...&|
00000320  05 cd 0d 02 30 13 3d 6d  69 6e 2b b3 28 6d 61 78  |....0.=min+.(max|
00000330  2d 6d 69 6e 29 0d ff                              |-min)..|
00000337