Home » Archimedes archive » Acorn User » AU 1998-04 A.adf » Regulars » StarInfo/Circles/Fobe

StarInfo/Circles/Fobe

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 » Archimedes archive » Acorn User » AU 1998-04 A.adf » Regulars
Filename: StarInfo/Circles/Fobe
Read OK:
File size: 02B6 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Fobe by dL 05Feb98
   20n=40
   30MODE 27:OFF
   40s=1
   50ON ERROR SYS 6,113,s:SYS 6,112,s:ERROR EXT ERR,REPORT$+" at line "+STR$ERL:END
   60FOR i=1 TO 15
   70 COLOUR i,i*17,255-i*17,0
   80NEXT
   90DIM x(n),y(n),r(n),a(n)
  100REPEAT
  110
  120 FOR i=0 TO n-1
  130 r(i)+=a(i)
  140 IF r(i)<=0 THEN
  150  REPEAT
  160   x(i)=RND(640)*2
  170   y(i)=RND(480)*2
  180  UNTIL POINT(x(i),y(i))=0
  190  r(i)=0
  200  a(i)=RND(1)*2+1
  210 ELSE
  220  j=0
  230  done=FALSE
  240  REPEAT
  250   IF i<>j THEN
  260    dx=x(j)-x(i)
  270    dy=y(j)-y(i)
  280    d=SQR(dx*dx+dy*dy)
  290    IF r(i)+r(j)>d r(i)-=a(i):a(i)=-2*a(i):done=TRUE
  300   ENDIF
  310   j+=1
  320  UNTIL j>=n OR done
  330 ENDIF
  340 NEXT
  350
  360 WAIT
  370 SYS 6,112,s
  380 SYS 6,113,3-s
  390 s=3-s
  400 CLS
  410 FOR i=0 TO n-1
  420  c=r(i)/8:IF c>15 c=15
  430  GCOL c
  440  CIRCLE FILL x(i),y(i),r(i)
  450 NEXT
  460UNTIL 0

� >Fobe by dL 05Feb98
n=40

� 27:�
(s=1
27� � ș 6,113,s:ș 6,112,s:� � �,�$+" at line "+Þ:�
<� i=1 � 15
F � i,i*17,255-i*17,0
P�
Z� x(n),y(n),r(n),a(n)
d�
n
x � i=0 � n-1
� r(i)+=a(i)
� � r(i)<=0 �
�  �
�   x(i)=�(640)*2
�   y(i)=�(480)*2
�  � �x(i),y(i))=0
�  r(i)=0
�  a(i)=�(1)*2+1
� �
�	  j=0
�  done=�
�  �
�   � i<>j �
    dx=x(j)-x(i)
    dy=y(j)-y(i)
    d=�(dx*dx+dy*dy)
"4    � r(i)+r(j)>d r(i)-=a(i):a(i)=-2*a(i):done=�
,   �
6   j+=1
@  � j>=n � done
J �
T �
^
h Ȗ
r ș 6,112,s
| ș 6,113,3-s
�
 s=3-s
� �
� � i=0 � n-1
�  c=r(i)/8:� c>15 c=15
�	  � c
�  ȏ Ȑ x(i),y(i),r(i)
� �
�� 0
�
00000000  0d 00 0a 19 f4 20 3e 46  6f 62 65 20 62 79 20 64  |..... >Fobe by d|
00000010  4c 20 30 35 46 65 62 39  38 0d 00 14 08 6e 3d 34  |L 05Feb98....n=4|
00000020  30 0d 00 1e 0a eb 20 32  37 3a 87 0d 00 28 07 73  |0..... 27:...(.s|
00000030  3d 31 0d 00 32 37 ee 20  85 20 c8 99 20 36 2c 31  |=1..27. . .. 6,1|
00000040  31 33 2c 73 3a c8 99 20  36 2c 31 31 32 2c 73 3a  |13,s:.. 6,112,s:|
00000050  85 20 a2 20 9f 2c f6 24  2b 22 20 61 74 20 6c 69  |. . .,.$+" at li|
00000060  6e 65 20 22 2b c3 9e 3a  e0 0d 00 3c 0e e3 20 69  |ne "+..:...<.. i|
00000070  3d 31 20 b8 20 31 35 0d  00 46 18 20 fb 20 69 2c  |=1 . 15..F. . i,|
00000080  69 2a 31 37 2c 32 35 35  2d 69 2a 31 37 2c 30 0d  |i*17,255-i*17,0.|
00000090  00 50 05 ed 0d 00 5a 19  de 20 78 28 6e 29 2c 79  |.P....Z.. x(n),y|
000000a0  28 6e 29 2c 72 28 6e 29  2c 61 28 6e 29 0d 00 64  |(n),r(n),a(n)..d|
000000b0  05 f5 0d 00 6e 04 0d 00  78 10 20 e3 20 69 3d 30  |....n...x. . i=0|
000000c0  20 b8 20 6e 2d 31 0d 00  82 0f 20 72 28 69 29 2b  | . n-1.... r(i)+|
000000d0  3d 61 28 69 29 0d 00 8c  10 20 e7 20 72 28 69 29  |=a(i).... . r(i)|
000000e0  3c 3d 30 20 8c 0d 00 96  07 20 20 f5 0d 00 a0 14  |<=0 .....  .....|
000000f0  20 20 20 78 28 69 29 3d  b3 28 36 34 30 29 2a 32  |   x(i)=.(640)*2|
00000100  0d 00 aa 14 20 20 20 79  28 69 29 3d b3 28 34 38  |....   y(i)=.(48|
00000110  30 29 2a 32 0d 00 b4 15  20 20 fd 20 b0 78 28 69  |0)*2....  . .x(i|
00000120  29 2c 79 28 69 29 29 3d  30 0d 00 be 0c 20 20 72  |),y(i))=0....  r|
00000130  28 69 29 3d 30 0d 00 c8  13 20 20 61 28 69 29 3d  |(i)=0....  a(i)=|
00000140  b3 28 31 29 2a 32 2b 31  0d 00 d2 06 20 cc 0d 00  |.(1)*2+1.... ...|
00000150  dc 09 20 20 6a 3d 30 0d  00 e6 0c 20 20 64 6f 6e  |..  j=0....  don|
00000160  65 3d a3 0d 00 f0 07 20  20 f5 0d 00 fa 0f 20 20  |e=.....  .....  |
00000170  20 e7 20 69 3c 3e 6a 20  8c 0d 01 04 14 20 20 20  | . i<>j .....   |
00000180  20 64 78 3d 78 28 6a 29  2d 78 28 69 29 0d 01 0e  | dx=x(j)-x(i)...|
00000190  14 20 20 20 20 64 79 3d  79 28 6a 29 2d 79 28 69  |.    dy=y(j)-y(i|
000001a0  29 0d 01 18 18 20 20 20  20 64 3d b6 28 64 78 2a  |)....    d=.(dx*|
000001b0  64 78 2b 64 79 2a 64 79  29 0d 01 22 34 20 20 20  |dx+dy*dy).."4   |
000001c0  20 e7 20 72 28 69 29 2b  72 28 6a 29 3e 64 20 72  | . r(i)+r(j)>d r|
000001d0  28 69 29 2d 3d 61 28 69  29 3a 61 28 69 29 3d 2d  |(i)-=a(i):a(i)=-|
000001e0  32 2a 61 28 69 29 3a 64  6f 6e 65 3d b9 0d 01 2c  |2*a(i):done=...,|
000001f0  08 20 20 20 cd 0d 01 36  0b 20 20 20 6a 2b 3d 31  |.   ...6.   j+=1|
00000200  0d 01 40 13 20 20 fd 20  6a 3e 3d 6e 20 84 20 64  |..@.  . j>=n . d|
00000210  6f 6e 65 0d 01 4a 06 20  cd 0d 01 54 06 20 ed 0d  |one..J. ...T. ..|
00000220  01 5e 04 0d 01 68 07 20  c8 96 0d 01 72 0f 20 c8  |.^...h. ....r. .|
00000230  99 20 36 2c 31 31 32 2c  73 0d 01 7c 11 20 c8 99  |. 6,112,s..|. ..|
00000240  20 36 2c 31 31 33 2c 33  2d 73 0d 01 86 0a 20 73  | 6,113,3-s.... s|
00000250  3d 33 2d 73 0d 01 90 06  20 db 0d 01 9a 10 20 e3  |=3-s.... ..... .|
00000260  20 69 3d 30 20 b8 20 6e  2d 31 0d 01 a4 1a 20 20  | i=0 . n-1....  |
00000270  63 3d 72 28 69 29 2f 38  3a e7 20 63 3e 31 35 20  |c=r(i)/8:. c>15 |
00000280  63 3d 31 35 0d 01 ae 09  20 20 e6 20 63 0d 01 b8  |c=15....  . c...|
00000290  1a 20 20 c8 8f 20 c8 90  20 78 28 69 29 2c 79 28  |.  .. .. x(i),y(|
000002a0  69 29 2c 72 28 69 29 0d  01 c2 06 20 ed 0d 01 cc  |i),r(i).... ....|
000002b0  07 fd 20 30 0d ff                                 |.. 0..|
000002b6