Home » Archimedes archive » Acorn User » AU 1997-Xmas B.adf » Regulars » StarInfo/Blake/3dPlanet3a

StarInfo/Blake/3dPlanet3a

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-Xmas B.adf » Regulars
Filename: StarInfo/Blake/3dPlanet3a
Read OK:
File size: 0282 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM 3d Planet Procedure
   20REM by D. Blake
   30REM v3a
   40:
   50MODE 28
   60ORIGIN 50,480
   70:
   80DIM height(300,300)
   90
  100height(0,0)=RND(64)
  110
  120FOR calc%=1 TO 300
  130 height(0,calc%)=height(0,calc%-1)+RND(3)-2
  140 height(calc%,0)=height(calc%-1,0)+RND(3)-2
  150NEXT
  160
  170max%=50
  180min%=50
  190
  200FOR y%=1 TO 300
  210 FOR x%=1 TO 300
  220  height(x%,y%)=((height(x%-1,y%)+height(x%,y%-1))/2)+RND(3)-2
  230  IF height(x%,y%)>max% max%=height(x%,y%)
  240  IF height(x%,y%)<min% min%=height(x%,y%)
  250  IF ((x%-150)*(x%-150))+((y%-150)*(y%-150))<22500 PROCplotit
  260 NEXT
  270NEXT
  280REPEATUNTILGET
  290RUN
  300END
  310
  320DEFPROCplotit
  330 GCOL 0,(INT(ABS(height(x%,y%))) MOD 64)
  340RECTANGLEFILL (y%+x%)*2,(x%-y%)*2,2,2
  350ENDPROC

� 3d Planet Procedure
� by D. Blake
	� v3a
(:
2� 28
<
ȑ 50,480
F:
P� height(300,300)
Z
dheight(0,0)=�(64)
n
x� calc%=1 � 300
�- height(0,calc%)=height(0,calc%-1)+�(3)-2
�- height(calc%,0)=height(calc%-1,0)+�(3)-2
��
�
�max%=50
�min%=50
�
�� y%=1 � 300
� � x%=1 � 300
�@  height(x%,y%)=((height(x%-1,y%)+height(x%,y%-1))/2)+�(3)-2
�-  � height(x%,y%)>max% max%=height(x%,y%)
�-  � height(x%,y%)<min% min%=height(x%,y%)
�=  � ((x%-150)*(x%-150))+((y%-150)*(y%-150))<22500 �plotit
 �
�
���
"�
,�
6
@��plotit
J# � 0,(�(�(height(x%,y%))) � 64)
T ȓȐ (y%+x%)*2,(x%-y%)*2,2,2
^�
�
00000000  0d 00 0a 19 f4 20 33 64  20 50 6c 61 6e 65 74 20  |..... 3d Planet |
00000010  50 72 6f 63 65 64 75 72  65 0d 00 14 11 f4 20 62  |Procedure..... b|
00000020  79 20 44 2e 20 42 6c 61  6b 65 0d 00 1e 09 f4 20  |y D. Blake..... |
00000030  76 33 61 0d 00 28 05 3a  0d 00 32 08 eb 20 32 38  |v3a..(.:..2.. 28|
00000040  0d 00 3c 0d c8 91 20 35  30 2c 34 38 30 0d 00 46  |..<... 50,480..F|
00000050  05 3a 0d 00 50 15 de 20  68 65 69 67 68 74 28 33  |.:..P.. height(3|
00000060  30 30 2c 33 30 30 29 0d  00 5a 04 0d 00 64 15 68  |00,300)..Z...d.h|
00000070  65 69 67 68 74 28 30 2c  30 29 3d b3 28 36 34 29  |eight(0,0)=.(64)|
00000080  0d 00 6e 04 0d 00 78 13  e3 20 63 61 6c 63 25 3d  |..n...x.. calc%=|
00000090  31 20 b8 20 33 30 30 0d  00 82 2d 20 68 65 69 67  |1 . 300...- heig|
000000a0  68 74 28 30 2c 63 61 6c  63 25 29 3d 68 65 69 67  |ht(0,calc%)=heig|
000000b0  68 74 28 30 2c 63 61 6c  63 25 2d 31 29 2b b3 28  |ht(0,calc%-1)+.(|
000000c0  33 29 2d 32 0d 00 8c 2d  20 68 65 69 67 68 74 28  |3)-2...- height(|
000000d0  63 61 6c 63 25 2c 30 29  3d 68 65 69 67 68 74 28  |calc%,0)=height(|
000000e0  63 61 6c 63 25 2d 31 2c  30 29 2b b3 28 33 29 2d  |calc%-1,0)+.(3)-|
000000f0  32 0d 00 96 05 ed 0d 00  a0 04 0d 00 aa 0b 6d 61  |2.............ma|
00000100  78 25 3d 35 30 0d 00 b4  0b 6d 69 6e 25 3d 35 30  |x%=50....min%=50|
00000110  0d 00 be 04 0d 00 c8 10  e3 20 79 25 3d 31 20 b8  |......... y%=1 .|
00000120  20 33 30 30 0d 00 d2 11  20 e3 20 78 25 3d 31 20  | 300.... . x%=1 |
00000130  b8 20 33 30 30 0d 00 dc  40 20 20 68 65 69 67 68  |. 300...@  heigh|
00000140  74 28 78 25 2c 79 25 29  3d 28 28 68 65 69 67 68  |t(x%,y%)=((heigh|
00000150  74 28 78 25 2d 31 2c 79  25 29 2b 68 65 69 67 68  |t(x%-1,y%)+heigh|
00000160  74 28 78 25 2c 79 25 2d  31 29 29 2f 32 29 2b b3  |t(x%,y%-1))/2)+.|
00000170  28 33 29 2d 32 0d 00 e6  2d 20 20 e7 20 68 65 69  |(3)-2...-  . hei|
00000180  67 68 74 28 78 25 2c 79  25 29 3e 6d 61 78 25 20  |ght(x%,y%)>max% |
00000190  6d 61 78 25 3d 68 65 69  67 68 74 28 78 25 2c 79  |max%=height(x%,y|
000001a0  25 29 0d 00 f0 2d 20 20  e7 20 68 65 69 67 68 74  |%)...-  . height|
000001b0  28 78 25 2c 79 25 29 3c  6d 69 6e 25 20 6d 69 6e  |(x%,y%)<min% min|
000001c0  25 3d 68 65 69 67 68 74  28 78 25 2c 79 25 29 0d  |%=height(x%,y%).|
000001d0  00 fa 3d 20 20 e7 20 28  28 78 25 2d 31 35 30 29  |..=  . ((x%-150)|
000001e0  2a 28 78 25 2d 31 35 30  29 29 2b 28 28 79 25 2d  |*(x%-150))+((y%-|
000001f0  31 35 30 29 2a 28 79 25  2d 31 35 30 29 29 3c 32  |150)*(y%-150))<2|
00000200  32 35 30 30 20 f2 70 6c  6f 74 69 74 0d 01 04 06  |2500 .plotit....|
00000210  20 ed 0d 01 0e 05 ed 0d  01 18 07 f5 fd a5 0d 01  | ...............|
00000220  22 05 f9 0d 01 2c 05 e0  0d 01 36 04 0d 01 40 0c  |"....,....6...@.|
00000230  dd f2 70 6c 6f 74 69 74  0d 01 4a 23 20 e6 20 30  |..plotit..J# . 0|
00000240  2c 28 a8 28 94 28 68 65  69 67 68 74 28 78 25 2c  |,(.(.(height(x%,|
00000250  79 25 29 29 29 20 83 20  36 34 29 0d 01 54 20 c8  |y%))) . 64)..T .|
00000260  93 c8 90 20 28 79 25 2b  78 25 29 2a 32 2c 28 78  |... (y%+x%)*2,(x|
00000270  25 2d 79 25 29 2a 32 2c  32 2c 32 0d 01 5e 05 e1  |%-y%)*2,2,2..^..|
00000280  0d ff                                             |..|
00000282