Home » Archimedes archive » Acorn User » AU 1997-06 B.adf » Regulars » StarInfo/Mellor/Electric

StarInfo/Mellor/Electric

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 1997-06 B.adf » Regulars
Filename: StarInfo/Mellor/Electric
Read OK:
File size: 04D3 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Electric
   20REM  Arcs of electricity?
   30REM  By Philip Mellor (age 15)
   40REM  Acorn User/Star Info
   50:
   60REM Error trapping
   70ON ERROR REPORT:PRINT" - ";ERL/10:END
   80:
   90REM Change modes, ensuring there is enough memory for two mode 9 screen banks
  100MODE12:MODE9
  110:
  120REM Turn that flashing cursor off
  130OFF
  140:
  150REM Change the palette to a range of blue to magenta
  160FOR I=1 TO 15
  170COLOUR I,255-I*17,0,255
  180NEXT
  190:
  200REM Set up the variables and arrays
  210fr=1:ball=80:r=48
  220max=5:REM Raise or lower this depending on your computer's speed :-)
  230DIM a(max),sx(max),sy(max)
  240:
  250FOR I=1 TO max
  260a(I)=RND(360)
  270sx(I)=640+(ball*SIN RAD a(I))
  280sy(I)=512+(ball*COS RAD a(I))
  290NEXT
  300:
  310REM Work out the start points for each arc of electricity
  320REPEAT
  330SYS6,112,fr:CLS
  340GCOL7
  350CIRCLE 640,512,ball
  360FOR I=1 TO max
  370PROCpath(sx(I),sy(I),a(I)+RND(8)-RND(16),1)
  380IF RND(25)=1 a(I)=RND(360):sx(I)=640+(ball*SIN RAD a(I)):sy(I)=512+(ball*COS RAD a(I))
  390NEXT
  400SYS6,113,fr
  410fr=3-fr:WAIT
  420UNTIL0
  430:
  440END
  450:
  460DEF PROCpath(x,y,a,c)
  470GCOL c
  480MOVE x,y
  490q=r*SIN RAD a
  500w=r*COS RAD a
  510x+=q:y+=w
  520IF POINT(x,y)<>-1 DRAW x,y:ok=TRUE ELSE ok=FALSE
  530IF ok=TRUE THEN
  540IF RND(20)=1 THEN
  550na=a
  560IF RND(2)=1 na+=RND(20)+10 ELSE na-=RND(20)+10
  570PROCpath(x,y,na,c)
  580ENDIF
  590IF RND(2)=1 a+=RND(20) ELSE a-=RND(20)
  600PROCpath(x,y,a,c+1)
  610ELSE
  620CIRCLE FILL x,y,32
  630ENDIF
  640ENDPROC

� >Electric
�  Arcs of electricity?
 �  By Philip Mellor (age 15)
(�  Acorn User/Star Info
2:
<� Error trapping
F� � �:�" - ";�/10:�
P:
ZO� Change modes, ensuring there is enough memory for two mode 9 screen banks
d
�12:�9
n:
x#� Turn that flashing cursor off
��
�:
�6� Change the palette to a range of blue to magenta
�� I=1 � 15
�� I,255-I*17,0,255
��
�:
�%� Set up the variables and arrays
�fr=1:ball=80:r=48
�Fmax=5:� Raise or lower this depending on your computer's speed :-)
�� a(max),sx(max),sy(max)
�:
�� I=1 � max
a(I)=�(360)
sx(I)=640+(ball*� � a(I))
sy(I)=512+(ball*� � a(I))
"�
,:
6;� Work out the start points for each arc of electricity
@�
Jș6,112,fr:�
T�7
^ȏ 640,512,ball
h� I=1 � max
r(�path(sx(I),sy(I),a(I)+�(8)-�(16),1)
|M� �(25)=1 a(I)=�(360):sx(I)=640+(ball*� � a(I)):sy(I)=512+(ball*� � a(I))
��
�ș6,113,fr
�fr=3-fr:Ȗ
��0
�:
��
�:
�� �path(x,y,a,c)
�� c
�	� x,y
�
q=r*� � a
�
w=r*� � a
�
x+=q:y+=w
!� �x,y)<>-1 � x,y:ok=� � ok=�
� ok=� �
� �(20)=1 �
&na=a
0(� �(2)=1 na+=�(20)+10 � na-=�(20)+10
:�path(x,y,na,c)
D�
N � �(2)=1 a+=�(20) � a-=�(20)
X�path(x,y,a,c+1)
b�
lȏ Ȑ x,y,32
v�
��
�
00000000  0d 00 0a 0f f4 20 3e 45  6c 65 63 74 72 69 63 0d  |..... >Electric.|
00000010  00 14 1b f4 20 20 41 72  63 73 20 6f 66 20 65 6c  |....  Arcs of el|
00000020  65 63 74 72 69 63 69 74  79 3f 0d 00 1e 20 f4 20  |ectricity?... . |
00000030  20 42 79 20 50 68 69 6c  69 70 20 4d 65 6c 6c 6f  | By Philip Mello|
00000040  72 20 28 61 67 65 20 31  35 29 0d 00 28 1b f4 20  |r (age 15)..(.. |
00000050  20 41 63 6f 72 6e 20 55  73 65 72 2f 53 74 61 72  | Acorn User/Star|
00000060  20 49 6e 66 6f 0d 00 32  05 3a 0d 00 3c 14 f4 20  | Info..2.:..<.. |
00000070  45 72 72 6f 72 20 74 72  61 70 70 69 6e 67 0d 00  |Error trapping..|
00000080  46 17 ee 20 85 20 f6 3a  f1 22 20 2d 20 22 3b 9e  |F.. . .:." - ";.|
00000090  2f 31 30 3a e0 0d 00 50  05 3a 0d 00 5a 4f f4 20  |/10:...P.:..ZO. |
000000a0  43 68 61 6e 67 65 20 6d  6f 64 65 73 2c 20 65 6e  |Change modes, en|
000000b0  73 75 72 69 6e 67 20 74  68 65 72 65 20 69 73 20  |suring there is |
000000c0  65 6e 6f 75 67 68 20 6d  65 6d 6f 72 79 20 66 6f  |enough memory fo|
000000d0  72 20 74 77 6f 20 6d 6f  64 65 20 39 20 73 63 72  |r two mode 9 scr|
000000e0  65 65 6e 20 62 61 6e 6b  73 0d 00 64 0a eb 31 32  |een banks..d..12|
000000f0  3a eb 39 0d 00 6e 05 3a  0d 00 78 23 f4 20 54 75  |:.9..n.:..x#. Tu|
00000100  72 6e 20 74 68 61 74 20  66 6c 61 73 68 69 6e 67  |rn that flashing|
00000110  20 63 75 72 73 6f 72 20  6f 66 66 0d 00 82 05 87  | cursor off.....|
00000120  0d 00 8c 05 3a 0d 00 96  36 f4 20 43 68 61 6e 67  |....:...6. Chang|
00000130  65 20 74 68 65 20 70 61  6c 65 74 74 65 20 74 6f  |e the palette to|
00000140  20 61 20 72 61 6e 67 65  20 6f 66 20 62 6c 75 65  | a range of blue|
00000150  20 74 6f 20 6d 61 67 65  6e 74 61 0d 00 a0 0e e3  | to magenta.....|
00000160  20 49 3d 31 20 b8 20 31  35 0d 00 aa 16 fb 20 49  | I=1 . 15..... I|
00000170  2c 32 35 35 2d 49 2a 31  37 2c 30 2c 32 35 35 0d  |,255-I*17,0,255.|
00000180  00 b4 05 ed 0d 00 be 05  3a 0d 00 c8 25 f4 20 53  |........:...%. S|
00000190  65 74 20 75 70 20 74 68  65 20 76 61 72 69 61 62  |et up the variab|
000001a0  6c 65 73 20 61 6e 64 20  61 72 72 61 79 73 0d 00  |les and arrays..|
000001b0  d2 15 66 72 3d 31 3a 62  61 6c 6c 3d 38 30 3a 72  |..fr=1:ball=80:r|
000001c0  3d 34 38 0d 00 dc 46 6d  61 78 3d 35 3a f4 20 52  |=48...Fmax=5:. R|
000001d0  61 69 73 65 20 6f 72 20  6c 6f 77 65 72 20 74 68  |aise or lower th|
000001e0  69 73 20 64 65 70 65 6e  64 69 6e 67 20 6f 6e 20  |is depending on |
000001f0  79 6f 75 72 20 63 6f 6d  70 75 74 65 72 27 73 20  |your computer's |
00000200  73 70 65 65 64 20 3a 2d  29 0d 00 e6 1c de 20 61  |speed :-)..... a|
00000210  28 6d 61 78 29 2c 73 78  28 6d 61 78 29 2c 73 79  |(max),sx(max),sy|
00000220  28 6d 61 78 29 0d 00 f0  05 3a 0d 00 fa 0f e3 20  |(max)....:..... |
00000230  49 3d 31 20 b8 20 6d 61  78 0d 01 04 0f 61 28 49  |I=1 . max....a(I|
00000240  29 3d b3 28 33 36 30 29  0d 01 0e 1d 73 78 28 49  |)=.(360)....sx(I|
00000250  29 3d 36 34 30 2b 28 62  61 6c 6c 2a b5 20 b2 20  |)=640+(ball*. . |
00000260  61 28 49 29 29 0d 01 18  1d 73 79 28 49 29 3d 35  |a(I))....sy(I)=5|
00000270  31 32 2b 28 62 61 6c 6c  2a 9b 20 b2 20 61 28 49  |12+(ball*. . a(I|
00000280  29 29 0d 01 22 05 ed 0d  01 2c 05 3a 0d 01 36 3b  |)).."....,.:..6;|
00000290  f4 20 57 6f 72 6b 20 6f  75 74 20 74 68 65 20 73  |. Work out the s|
000002a0  74 61 72 74 20 70 6f 69  6e 74 73 20 66 6f 72 20  |tart points for |
000002b0  65 61 63 68 20 61 72 63  20 6f 66 20 65 6c 65 63  |each arc of elec|
000002c0  74 72 69 63 69 74 79 0d  01 40 05 f5 0d 01 4a 10  |tricity..@....J.|
000002d0  c8 99 36 2c 31 31 32 2c  66 72 3a db 0d 01 54 06  |..6,112,fr:...T.|
000002e0  e6 37 0d 01 5e 13 c8 8f  20 36 34 30 2c 35 31 32  |.7..^... 640,512|
000002f0  2c 62 61 6c 6c 0d 01 68  0f e3 20 49 3d 31 20 b8  |,ball..h.. I=1 .|
00000300  20 6d 61 78 0d 01 72 28  f2 70 61 74 68 28 73 78  | max..r(.path(sx|
00000310  28 49 29 2c 73 79 28 49  29 2c 61 28 49 29 2b b3  |(I),sy(I),a(I)+.|
00000320  28 38 29 2d b3 28 31 36  29 2c 31 29 0d 01 7c 4d  |(8)-.(16),1)..|M|
00000330  e7 20 b3 28 32 35 29 3d  31 20 61 28 49 29 3d b3  |. .(25)=1 a(I)=.|
00000340  28 33 36 30 29 3a 73 78  28 49 29 3d 36 34 30 2b  |(360):sx(I)=640+|
00000350  28 62 61 6c 6c 2a b5 20  b2 20 61 28 49 29 29 3a  |(ball*. . a(I)):|
00000360  73 79 28 49 29 3d 35 31  32 2b 28 62 61 6c 6c 2a  |sy(I)=512+(ball*|
00000370  9b 20 b2 20 61 28 49 29  29 0d 01 86 05 ed 0d 01  |. . a(I)).......|
00000380  90 0e c8 99 36 2c 31 31  33 2c 66 72 0d 01 9a 0e  |....6,113,fr....|
00000390  66 72 3d 33 2d 66 72 3a  c8 96 0d 01 a4 06 fd 30  |fr=3-fr:.......0|
000003a0  0d 01 ae 05 3a 0d 01 b8  05 e0 0d 01 c2 05 3a 0d  |....:.........:.|
000003b0  01 cc 14 dd 20 f2 70 61  74 68 28 78 2c 79 2c 61  |.... .path(x,y,a|
000003c0  2c 63 29 0d 01 d6 07 e6  20 63 0d 01 e0 09 ec 20  |,c)..... c..... |
000003d0  78 2c 79 0d 01 ea 0d 71  3d 72 2a b5 20 b2 20 61  |x,y....q=r*. . a|
000003e0  0d 01 f4 0d 77 3d 72 2a  9b 20 b2 20 61 0d 01 fe  |....w=r*. . a...|
000003f0  0d 78 2b 3d 71 3a 79 2b  3d 77 0d 02 08 21 e7 20  |.x+=q:y+=w...!. |
00000400  b0 78 2c 79 29 3c 3e 2d  31 20 df 20 78 2c 79 3a  |.x,y)<>-1 . x,y:|
00000410  6f 6b 3d b9 20 8b 20 6f  6b 3d a3 0d 02 12 0c e7  |ok=. . ok=......|
00000420  20 6f 6b 3d b9 20 8c 0d  02 1c 0f e7 20 b3 28 32  | ok=. ...... .(2|
00000430  30 29 3d 31 20 8c 0d 02  26 08 6e 61 3d 61 0d 02  |0)=1 ...&.na=a..|
00000440  30 28 e7 20 b3 28 32 29  3d 31 20 6e 61 2b 3d b3  |0(. .(2)=1 na+=.|
00000450  28 32 30 29 2b 31 30 20  8b 20 6e 61 2d 3d b3 28  |(20)+10 . na-=.(|
00000460  32 30 29 2b 31 30 0d 02  3a 13 f2 70 61 74 68 28  |20)+10..:..path(|
00000470  78 2c 79 2c 6e 61 2c 63  29 0d 02 44 05 cd 0d 02  |x,y,na,c)..D....|
00000480  4e 20 e7 20 b3 28 32 29  3d 31 20 61 2b 3d b3 28  |N . .(2)=1 a+=.(|
00000490  32 30 29 20 8b 20 61 2d  3d b3 28 32 30 29 0d 02  |20) . a-=.(20)..|
000004a0  58 14 f2 70 61 74 68 28  78 2c 79 2c 61 2c 63 2b  |X..path(x,y,a,c+|
000004b0  31 29 0d 02 62 05 cc 0d  02 6c 10 c8 8f 20 c8 90  |1)..b....l... ..|
000004c0  20 78 2c 79 2c 33 32 0d  02 76 05 cd 0d 02 80 05  | x,y,32..v......|
000004d0  e1 0d ff                                          |...|
000004d3