Home » Archimedes archive » Acorn User » AU 1997-05 B.adf » Regulars » StarInfo/tunnel/Tunnelq

StarInfo/tunnel/Tunnelq

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-05 B.adf » Regulars
Filename: StarInfo/tunnel/Tunnelq
Read OK:
File size: 0381 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Tunnelq
   20REM example tunnel
   30REM by dL
   40REM (c) AU may 1997
   50:
   60MODE 28:MODE 27:OFF
   70DIM sin(360),cos(360)
   80FOR i=0 TO 15
   90 COLOUR i,i*17,i*17,i*17
  100NEXT
  110FOR i=0 TO 360
  120 sin(i)=SINRAD(i)
  130 cos(i)=COSRAD(i)
  140NEXT
  150deepest=512
  160space =32
  170n=12
  180
  190steps = deepest DIV space
  200degrees=360/n
  210DIM x(steps, n), y(steps, n)
  220angle=0
  230scr=1
  240deep=0
  250REPEAT
  260
  270 ang=angle
  280 i=0
  290 FOR depth=0 TO deepest STEP space
  300  j=0
  310   FOR a=ang TO 360+ang STEP degrees
  320   d = 30000 DIV (deep+depth+10)
  330   x(i,j)=640+d*sin(a MOD 360)
  340   y(i,j)=480+d*cos(a MOD 360)
  350   j+=1
  360  NEXT
  370  i+=1
  380 NEXT
  390 deep=(deep-4+space)MOD space
  400 angle=(angle+1+360) MOD 360
  410
  420 scr=3-scr
  430 WAIT
  440 SYS 6,112,scr
  450 SYS 6,113,3-scr
  460 CLS
  470 FOR i=0 TO steps-2
  480  GCOL (steps-2-i)*15/(steps-2)
  490  FOR j=0 TO n
  500   j1=(j+1) MOD n
  510   MOVE x(i,j1),y(i,j1)
  520   DRAW x(i,j),y(i,j)
  530   DRAW x(i+1,j1),y(i+1,j1)
  540  NEXT
  550 NEXT
  560UNTIL 0

� >Tunnelq
� example tunnel
� by dL
(� (c) AU may 1997
2:
<� 28:� 27:�
F� sin(360),cos(360)
P� i=0 � 15
Z � i,i*17,i*17,i*17
d�
n� i=0 � 360
x sin(i)=��(i)
� cos(i)=��(i)
��
�deepest=512
�
space =32
�n=12
�
�steps = deepest � space
�degrees=360/n
�� x(steps, n), y(steps, n)
�angle=0
�	scr=1
�
deep=0
��

 ang=angle
 i=0
"  � depth=0 � deepest � space
,	  j=0
6"   � a=ang � 360+ang � degrees
@"   d = 30000 � (deep+depth+10)
J    x(i,j)=640+d*sin(a � 360)
T    y(i,j)=480+d*cos(a � 360)
^   j+=1
h  �
r
  i+=1
| �
� deep=(deep-4+space)� space
� angle=(angle+1+360) � 360
�
� scr=3-scr
� Ȗ
� ș 6,112,scr
� ș 6,113,3-scr
� �
� � i=0 � steps-2
�   � (steps-2-i)*15/(steps-2)
�  � j=0 � n
�   j1=(j+1) � n
�   � x(i,j1),y(i,j1)
   � x(i,j),y(i,j)
   � x(i+1,j1),y(i+1,j1)
  �
& �
0� 0
�
00000000  0d 00 0a 0e f4 20 3e 54  75 6e 6e 65 6c 71 0d 00  |..... >Tunnelq..|
00000010  14 14 f4 20 65 78 61 6d  70 6c 65 20 74 75 6e 6e  |... example tunn|
00000020  65 6c 0d 00 1e 0b f4 20  62 79 20 64 4c 0d 00 28  |el..... by dL..(|
00000030  15 f4 20 28 63 29 20 41  55 20 6d 61 79 20 31 39  |.. (c) AU may 19|
00000040  39 37 0d 00 32 05 3a 0d  00 3c 0f eb 20 32 38 3a  |97..2.:..<.. 28:|
00000050  eb 20 32 37 3a 87 0d 00  46 17 de 20 73 69 6e 28  |. 27:...F.. sin(|
00000060  33 36 30 29 2c 63 6f 73  28 33 36 30 29 0d 00 50  |360),cos(360)..P|
00000070  0e e3 20 69 3d 30 20 b8  20 31 35 0d 00 5a 17 20  |.. i=0 . 15..Z. |
00000080  fb 20 69 2c 69 2a 31 37  2c 69 2a 31 37 2c 69 2a  |. i,i*17,i*17,i*|
00000090  31 37 0d 00 64 05 ed 0d  00 6e 0f e3 20 69 3d 30  |17..d....n.. i=0|
000000a0  20 b8 20 33 36 30 0d 00  78 11 20 73 69 6e 28 69  | . 360..x. sin(i|
000000b0  29 3d b5 b2 28 69 29 0d  00 82 11 20 63 6f 73 28  |)=..(i).... cos(|
000000c0  69 29 3d 9b b2 28 69 29  0d 00 8c 05 ed 0d 00 96  |i)=..(i)........|
000000d0  0f 64 65 65 70 65 73 74  3d 35 31 32 0d 00 a0 0d  |.deepest=512....|
000000e0  73 70 61 63 65 20 3d 33  32 0d 00 aa 08 6e 3d 31  |space =32....n=1|
000000f0  32 0d 00 b4 04 0d 00 be  1b 73 74 65 70 73 20 3d  |2........steps =|
00000100  20 64 65 65 70 65 73 74  20 81 20 73 70 61 63 65  | deepest . space|
00000110  0d 00 c8 11 64 65 67 72  65 65 73 3d 33 36 30 2f  |....degrees=360/|
00000120  6e 0d 00 d2 1e de 20 78  28 73 74 65 70 73 2c 20  |n..... x(steps, |
00000130  6e 29 2c 20 79 28 73 74  65 70 73 2c 20 6e 29 0d  |n), y(steps, n).|
00000140  00 dc 0b 61 6e 67 6c 65  3d 30 0d 00 e6 09 73 63  |...angle=0....sc|
00000150  72 3d 31 0d 00 f0 0a 64  65 65 70 3d 30 0d 00 fa  |r=1....deep=0...|
00000160  05 f5 0d 01 04 04 0d 01  0e 0e 20 61 6e 67 3d 61  |.......... ang=a|
00000170  6e 67 6c 65 0d 01 18 08  20 69 3d 30 0d 01 22 20  |ngle.... i=0.." |
00000180  20 e3 20 64 65 70 74 68  3d 30 20 b8 20 64 65 65  | . depth=0 . dee|
00000190  70 65 73 74 20 88 20 73  70 61 63 65 0d 01 2c 09  |pest . space..,.|
000001a0  20 20 6a 3d 30 0d 01 36  22 20 20 20 e3 20 61 3d  |  j=0..6"   . a=|
000001b0  61 6e 67 20 b8 20 33 36  30 2b 61 6e 67 20 88 20  |ang . 360+ang . |
000001c0  64 65 67 72 65 65 73 0d  01 40 22 20 20 20 64 20  |degrees..@"   d |
000001d0  3d 20 33 30 30 30 30 20  81 20 28 64 65 65 70 2b  |= 30000 . (deep+|
000001e0  64 65 70 74 68 2b 31 30  29 0d 01 4a 20 20 20 20  |depth+10)..J    |
000001f0  78 28 69 2c 6a 29 3d 36  34 30 2b 64 2a 73 69 6e  |x(i,j)=640+d*sin|
00000200  28 61 20 83 20 33 36 30  29 0d 01 54 20 20 20 20  |(a . 360)..T    |
00000210  79 28 69 2c 6a 29 3d 34  38 30 2b 64 2a 63 6f 73  |y(i,j)=480+d*cos|
00000220  28 61 20 83 20 33 36 30  29 0d 01 5e 0b 20 20 20  |(a . 360)..^.   |
00000230  6a 2b 3d 31 0d 01 68 07  20 20 ed 0d 01 72 0a 20  |j+=1..h.  ...r. |
00000240  20 69 2b 3d 31 0d 01 7c  06 20 ed 0d 01 86 1f 20  | i+=1..|. ..... |
00000250  64 65 65 70 3d 28 64 65  65 70 2d 34 2b 73 70 61  |deep=(deep-4+spa|
00000260  63 65 29 83 20 73 70 61  63 65 0d 01 90 1e 20 61  |ce). space.... a|
00000270  6e 67 6c 65 3d 28 61 6e  67 6c 65 2b 31 2b 33 36  |ngle=(angle+1+36|
00000280  30 29 20 83 20 33 36 30  0d 01 9a 04 0d 01 a4 0e  |0) . 360........|
00000290  20 73 63 72 3d 33 2d 73  63 72 0d 01 ae 07 20 c8  | scr=3-scr.... .|
000002a0  96 0d 01 b8 11 20 c8 99  20 36 2c 31 31 32 2c 73  |..... .. 6,112,s|
000002b0  63 72 0d 01 c2 13 20 c8  99 20 36 2c 31 31 33 2c  |cr.... .. 6,113,|
000002c0  33 2d 73 63 72 0d 01 cc  06 20 db 0d 01 d6 14 20  |3-scr.... ..... |
000002d0  e3 20 69 3d 30 20 b8 20  73 74 65 70 73 2d 32 0d  |. i=0 . steps-2.|
000002e0  01 e0 20 20 20 e6 20 28  73 74 65 70 73 2d 32 2d  |..   . (steps-2-|
000002f0  69 29 2a 31 35 2f 28 73  74 65 70 73 2d 32 29 0d  |i)*15/(steps-2).|
00000300  01 ea 0f 20 20 e3 20 6a  3d 30 20 b8 20 6e 0d 01  |...  . j=0 . n..|
00000310  f4 13 20 20 20 6a 31 3d  28 6a 2b 31 29 20 83 20  |..   j1=(j+1) . |
00000320  6e 0d 01 fe 18 20 20 20  ec 20 78 28 69 2c 6a 31  |n....   . x(i,j1|
00000330  29 2c 79 28 69 2c 6a 31  29 0d 02 08 16 20 20 20  |),y(i,j1)....   |
00000340  df 20 78 28 69 2c 6a 29  2c 79 28 69 2c 6a 29 0d  |. x(i,j),y(i,j).|
00000350  02 12 1c 20 20 20 df 20  78 28 69 2b 31 2c 6a 31  |...   . x(i+1,j1|
00000360  29 2c 79 28 69 2b 31 2c  6a 31 29 0d 02 1c 07 20  |),y(i+1,j1).... |
00000370  20 ed 0d 02 26 06 20 ed  0d 02 30 07 fd 20 30 0d  | ...&. ...0.. 0.|
00000380  ff                                                |.|
00000381