Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Automatons/Gasket

!AWJan92/Goodies/ArcAut/Automatons/Gasket

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_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Automatons/Gasket
Read OK:
File size: 02C4 bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  Gasket

  This automaton grows a structure resembling the well known Sierpinski
  gasket. The Moore neighbourhood is used.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap off
  30*SetEval border dead
  40ENDPROC

SCREEN*

  10DEF PROCdo
  20DIM buf% 256:SYS "OS_ReadVarVal","suy",buf%,256
  30GCOL 128 TINT 0:CLG
  40GCOL 63 TINT 255:POINT 0,!buf%*2-8
  50ENDPROC

CODE*

( CELL 0 <> IF (CELL ==)
  READ_NEIG
  TR 253 = IF (TL 245 = IF (243 ==))
  TR 252 > IF (TR 1 - ==)
  TL 255 = IF (244 ==)
  TL 243 > IF (TL 246 < IF (TL 1 + ==))
  MR 245 > IF (MR 251 < IF (MR 1 + ==))
  MR 243 = IF (247 ==)
  TM 252 = IF (255 ==)
  TM 246 = IF (255 ==)
  dead ==                               )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 47 61  |AUTOMATON*..  Ga|
00000010  73 6b 65 74 0a 0a 20 20  54 68 69 73 20 61 75 74  |sket..  This aut|
00000020  6f 6d 61 74 6f 6e 20 67  72 6f 77 73 20 61 20 73  |omaton grows a s|
00000030  74 72 75 63 74 75 72 65  20 72 65 73 65 6d 62 6c  |tructure resembl|
00000040  69 6e 67 20 74 68 65 20  77 65 6c 6c 20 6b 6e 6f  |ing the well kno|
00000050  77 6e 20 53 69 65 72 70  69 6e 73 6b 69 0a 20 20  |wn Sierpinski.  |
00000060  67 61 73 6b 65 74 2e 20  54 68 65 20 4d 6f 6f 72  |gasket. The Moor|
00000070  65 20 6e 65 69 67 68 62  6f 75 72 68 6f 6f 64 20  |e neighbourhood |
00000080  69 73 20 75 73 65 64 2e  0a 0a 49 4e 49 54 49 41  |is used...INITIA|
00000090  4c 49 53 41 54 49 4f 4e  2a 0a 0a 20 20 31 30 44  |LISATION*..  10D|
000000a0  45 46 20 50 52 4f 43 64  6f 0a 20 20 32 30 2a 53  |EF PROCdo.  20*S|
000000b0  65 74 45 76 61 6c 20 77  72 61 70 20 6f 66 66 0a  |etEval wrap off.|
000000c0  20 20 33 30 2a 53 65 74  45 76 61 6c 20 62 6f 72  |  30*SetEval bor|
000000d0  64 65 72 20 64 65 61 64  0a 20 20 34 30 45 4e 44  |der dead.  40END|
000000e0  50 52 4f 43 0a 0a 53 43  52 45 45 4e 2a 0a 0a 20  |PROC..SCREEN*.. |
000000f0  20 31 30 44 45 46 20 50  52 4f 43 64 6f 0a 20 20  | 10DEF PROCdo.  |
00000100  32 30 44 49 4d 20 62 75  66 25 20 32 35 36 3a 53  |20DIM buf% 256:S|
00000110  59 53 20 22 4f 53 5f 52  65 61 64 56 61 72 56 61  |YS "OS_ReadVarVa|
00000120  6c 22 2c 22 73 75 79 22  2c 62 75 66 25 2c 32 35  |l","suy",buf%,25|
00000130  36 0a 20 20 33 30 47 43  4f 4c 20 31 32 38 20 54  |6.  30GCOL 128 T|
00000140  49 4e 54 20 30 3a 43 4c  47 0a 20 20 34 30 47 43  |INT 0:CLG.  40GC|
00000150  4f 4c 20 36 33 20 54 49  4e 54 20 32 35 35 3a 50  |OL 63 TINT 255:P|
00000160  4f 49 4e 54 20 30 2c 21  62 75 66 25 2a 32 2d 38  |OINT 0,!buf%*2-8|
00000170  0a 20 20 35 30 45 4e 44  50 52 4f 43 0a 0a 43 4f  |.  50ENDPROC..CO|
00000180  44 45 2a 0a 0a 28 20 43  45 4c 4c 20 30 20 3c 3e  |DE*..( CELL 0 <>|
00000190  20 49 46 20 28 43 45 4c  4c 20 3d 3d 29 0a 20 20  | IF (CELL ==).  |
000001a0  52 45 41 44 5f 4e 45 49  47 0a 20 20 54 52 20 32  |READ_NEIG.  TR 2|
000001b0  35 33 20 3d 20 49 46 20  28 54 4c 20 32 34 35 20  |53 = IF (TL 245 |
000001c0  3d 20 49 46 20 28 32 34  33 20 3d 3d 29 29 0a 20  |= IF (243 ==)). |
000001d0  20 54 52 20 32 35 32 20  3e 20 49 46 20 28 54 52  | TR 252 > IF (TR|
000001e0  20 31 20 2d 20 3d 3d 29  0a 20 20 54 4c 20 32 35  | 1 - ==).  TL 25|
000001f0  35 20 3d 20 49 46 20 28  32 34 34 20 3d 3d 29 0a  |5 = IF (244 ==).|
00000200  20 20 54 4c 20 32 34 33  20 3e 20 49 46 20 28 54  |  TL 243 > IF (T|
00000210  4c 20 32 34 36 20 3c 20  49 46 20 28 54 4c 20 31  |L 246 < IF (TL 1|
00000220  20 2b 20 3d 3d 29 29 0a  20 20 4d 52 20 32 34 35  | + ==)).  MR 245|
00000230  20 3e 20 49 46 20 28 4d  52 20 32 35 31 20 3c 20  | > IF (MR 251 < |
00000240  49 46 20 28 4d 52 20 31  20 2b 20 3d 3d 29 29 0a  |IF (MR 1 + ==)).|
00000250  20 20 4d 52 20 32 34 33  20 3d 20 49 46 20 28 32  |  MR 243 = IF (2|
00000260  34 37 20 3d 3d 29 0a 20  20 54 4d 20 32 35 32 20  |47 ==).  TM 252 |
00000270  3d 20 49 46 20 28 32 35  35 20 3d 3d 29 0a 20 20  |= IF (255 ==).  |
00000280  54 4d 20 32 34 36 20 3d  20 49 46 20 28 32 35 35  |TM 246 = IF (255|
00000290  20 3d 3d 29 0a 20 20 64  65 61 64 20 3d 3d 20 20  | ==).  dead ==  |
000002a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002b0  20 20 20 20 20 20 20 20  20 20 20 20 20 29 0a 0a  |             )..|
000002c0  45 4e 44 2a                                       |END*|
000002c4