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

!AWJan92/Goodies/ArcAut/Automatons/Critter

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/Critter
Read OK:
File size: 03BB bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  Critter

  A two state automaton in which most cells reverse their state with each
  generations (this can lead to a painful flashing display, hence the subdued
  colours). From a random blob of mixed states on a plain background, strange
  four cell 'critters' mysteriously appear, wander across the display, & then
  fall back into the oblivion from which they came. This uses the margolus
  neighbourhood. Try 253x14 & other small windows.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap on
  30*SetEval neig margolus
  40*SetEval i 10
  50ENDPROC

SCREEN*

  10DEF PROCdo   
  20DIM buf% 256:SYS "OS_ReadVarVal","i",buf%,256
  30c%=FNacol(!buf%)
  40GCOL c%AND63 TINT c%
  50FOR Q%=1 TO 200
  60POINT RND(80)-40,RND(80)-40
  70NEXT
  80ENDPROC

CODE*

( READ_NEIG
  <i> SCOUNT_ALL
  DUP 0 = IF (CELL <i> EOR ==)
  DUP 1 = IF (CELL <i> EOR ==)
  DUP 2 = IF (CELL ==)
      3 = IF (OPP <i> EOR ==)
              CELL <i> EOR ==  )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 43 72  |AUTOMATON*..  Cr|
00000010  69 74 74 65 72 0a 0a 20  20 41 20 74 77 6f 20 73  |itter..  A two s|
00000020  74 61 74 65 20 61 75 74  6f 6d 61 74 6f 6e 20 69  |tate automaton i|
00000030  6e 20 77 68 69 63 68 20  6d 6f 73 74 20 63 65 6c  |n which most cel|
00000040  6c 73 20 72 65 76 65 72  73 65 20 74 68 65 69 72  |ls reverse their|
00000050  20 73 74 61 74 65 20 77  69 74 68 20 65 61 63 68  | state with each|
00000060  0a 20 20 67 65 6e 65 72  61 74 69 6f 6e 73 20 28  |.  generations (|
00000070  74 68 69 73 20 63 61 6e  20 6c 65 61 64 20 74 6f  |this can lead to|
00000080  20 61 20 70 61 69 6e 66  75 6c 20 66 6c 61 73 68  | a painful flash|
00000090  69 6e 67 20 64 69 73 70  6c 61 79 2c 20 68 65 6e  |ing display, hen|
000000a0  63 65 20 74 68 65 20 73  75 62 64 75 65 64 0a 20  |ce the subdued. |
000000b0  20 63 6f 6c 6f 75 72 73  29 2e 20 46 72 6f 6d 20  | colours). From |
000000c0  61 20 72 61 6e 64 6f 6d  20 62 6c 6f 62 20 6f 66  |a random blob of|
000000d0  20 6d 69 78 65 64 20 73  74 61 74 65 73 20 6f 6e  | mixed states on|
000000e0  20 61 20 70 6c 61 69 6e  20 62 61 63 6b 67 72 6f  | a plain backgro|
000000f0  75 6e 64 2c 20 73 74 72  61 6e 67 65 0a 20 20 66  |und, strange.  f|
00000100  6f 75 72 20 63 65 6c 6c  20 27 63 72 69 74 74 65  |our cell 'critte|
00000110  72 73 27 20 6d 79 73 74  65 72 69 6f 75 73 6c 79  |rs' mysteriously|
00000120  20 61 70 70 65 61 72 2c  20 77 61 6e 64 65 72 20  | appear, wander |
00000130  61 63 72 6f 73 73 20 74  68 65 20 64 69 73 70 6c  |across the displ|
00000140  61 79 2c 20 26 20 74 68  65 6e 0a 20 20 66 61 6c  |ay, & then.  fal|
00000150  6c 20 62 61 63 6b 20 69  6e 74 6f 20 74 68 65 20  |l back into the |
00000160  6f 62 6c 69 76 69 6f 6e  20 66 72 6f 6d 20 77 68  |oblivion from wh|
00000170  69 63 68 20 74 68 65 79  20 63 61 6d 65 2e 20 54  |ich they came. T|
00000180  68 69 73 20 75 73 65 73  20 74 68 65 20 6d 61 72  |his uses the mar|
00000190  67 6f 6c 75 73 0a 20 20  6e 65 69 67 68 62 6f 75  |golus.  neighbou|
000001a0  72 68 6f 6f 64 2e 20 54  72 79 20 32 35 33 78 31  |rhood. Try 253x1|
000001b0  34 20 26 20 6f 74 68 65  72 20 73 6d 61 6c 6c 20  |4 & other small |
000001c0  77 69 6e 64 6f 77 73 2e  0a 0a 49 4e 49 54 49 41  |windows...INITIA|
000001d0  4c 49 53 41 54 49 4f 4e  2a 0a 0a 20 20 31 30 44  |LISATION*..  10D|
000001e0  45 46 20 50 52 4f 43 64  6f 0a 20 20 32 30 2a 53  |EF PROCdo.  20*S|
000001f0  65 74 45 76 61 6c 20 77  72 61 70 20 6f 6e 0a 20  |etEval wrap on. |
00000200  20 33 30 2a 53 65 74 45  76 61 6c 20 6e 65 69 67  | 30*SetEval neig|
00000210  20 6d 61 72 67 6f 6c 75  73 0a 20 20 34 30 2a 53  | margolus.  40*S|
00000220  65 74 45 76 61 6c 20 69  20 31 30 0a 20 20 35 30  |etEval i 10.  50|
00000230  45 4e 44 50 52 4f 43 0a  0a 53 43 52 45 45 4e 2a  |ENDPROC..SCREEN*|
00000240  0a 0a 20 20 31 30 44 45  46 20 50 52 4f 43 64 6f  |..  10DEF PROCdo|
00000250  20 20 20 0a 20 20 32 30  44 49 4d 20 62 75 66 25  |   .  20DIM buf%|
00000260  20 32 35 36 3a 53 59 53  20 22 4f 53 5f 52 65 61  | 256:SYS "OS_Rea|
00000270  64 56 61 72 56 61 6c 22  2c 22 69 22 2c 62 75 66  |dVarVal","i",buf|
00000280  25 2c 32 35 36 0a 20 20  33 30 63 25 3d 46 4e 61  |%,256.  30c%=FNa|
00000290  63 6f 6c 28 21 62 75 66  25 29 0a 20 20 34 30 47  |col(!buf%).  40G|
000002a0  43 4f 4c 20 63 25 41 4e  44 36 33 20 54 49 4e 54  |COL c%AND63 TINT|
000002b0  20 63 25 0a 20 20 35 30  46 4f 52 20 51 25 3d 31  | c%.  50FOR Q%=1|
000002c0  20 54 4f 20 32 30 30 0a  20 20 36 30 50 4f 49 4e  | TO 200.  60POIN|
000002d0  54 20 52 4e 44 28 38 30  29 2d 34 30 2c 52 4e 44  |T RND(80)-40,RND|
000002e0  28 38 30 29 2d 34 30 0a  20 20 37 30 4e 45 58 54  |(80)-40.  70NEXT|
000002f0  0a 20 20 38 30 45 4e 44  50 52 4f 43 0a 0a 43 4f  |.  80ENDPROC..CO|
00000300  44 45 2a 0a 0a 28 20 52  45 41 44 5f 4e 45 49 47  |DE*..( READ_NEIG|
00000310  0a 20 20 3c 69 3e 20 53  43 4f 55 4e 54 5f 41 4c  |.  <i> SCOUNT_AL|
00000320  4c 0a 20 20 44 55 50 20  30 20 3d 20 49 46 20 28  |L.  DUP 0 = IF (|
00000330  43 45 4c 4c 20 3c 69 3e  20 45 4f 52 20 3d 3d 29  |CELL <i> EOR ==)|
00000340  0a 20 20 44 55 50 20 31  20 3d 20 49 46 20 28 43  |.  DUP 1 = IF (C|
00000350  45 4c 4c 20 3c 69 3e 20  45 4f 52 20 3d 3d 29 0a  |ELL <i> EOR ==).|
00000360  20 20 44 55 50 20 32 20  3d 20 49 46 20 28 43 45  |  DUP 2 = IF (CE|
00000370  4c 4c 20 3d 3d 29 0a 20  20 20 20 20 20 33 20 3d  |LL ==).      3 =|
00000380  20 49 46 20 28 4f 50 50  20 3c 69 3e 20 45 4f 52  | IF (OPP <i> EOR|
00000390  20 3d 3d 29 0a 20 20 20  20 20 20 20 20 20 20 20  | ==).           |
000003a0  20 20 20 43 45 4c 4c 20  3c 69 3e 20 45 4f 52 20  |   CELL <i> EOR |
000003b0  3d 3d 20 20 29 0a 0a 45  4e 44 2a                 |==  )..END*|
000003bb