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

!AWJan92/Goodies/ArcAut/Automatons/BrianBrain

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/BrianBrain
Read OK:
File size: 050F bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  Brian's_Brain

  The owner of the escaped brain in question, is one Brian Silverman. His
  brain is a deceptively simple three state automaton, run in the Moore
  neighbourhood. The three states are referred to as 'ready', 'firing' &
  'refractory'. A cell which has just fired will become refractory on the
  next generation & then revert to ready. Ready cells will subsequently fire
  if they have precisely two firing neigbours. This results in pulses of
  firing cells drifting across the brain, colliding & sending off signals in
  other directions. An initial soup quickly settles down to a typical level
  of activity. Try a window of 200x100.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap on
  30*SetEval ready 127
  40*SetEval firing 96
  50*SetEval refractory 22
  60ENDPROC

SCREEN*

  10DEF PROCdo
  20DIM buf% 256:SYS "OS_ReadVarVal","ready",buf%,256:rea=!buf%
  30SYS "OS_ReadVarVal","firing",buf%,256:fir=!buf%
  40SYS "OS_ReadVarVal","refractory",buf%,256:ref=!buf%
  50PROCsoup(ref,1,1)
  60PROCsoup(rea,1,.5):PROCsoup(fir,1,.33)
  70ENDPROC

CODE*

( CELL <ready>  = IF (READ_NEIG <firing> SCOUNT_NEIG
                      2 = IF (<firing> ==) <ready> ==)
  CELL <firing> = IF (<refractory> ==)
                      <ready>      ==                  )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 42 72  |AUTOMATON*..  Br|
00000010  69 61 6e 27 73 5f 42 72  61 69 6e 0a 0a 20 20 54  |ian's_Brain..  T|
00000020  68 65 20 6f 77 6e 65 72  20 6f 66 20 74 68 65 20  |he owner of the |
00000030  65 73 63 61 70 65 64 20  62 72 61 69 6e 20 69 6e  |escaped brain in|
00000040  20 71 75 65 73 74 69 6f  6e 2c 20 69 73 20 6f 6e  | question, is on|
00000050  65 20 42 72 69 61 6e 20  53 69 6c 76 65 72 6d 61  |e Brian Silverma|
00000060  6e 2e 20 48 69 73 0a 20  20 62 72 61 69 6e 20 69  |n. His.  brain i|
00000070  73 20 61 20 64 65 63 65  70 74 69 76 65 6c 79 20  |s a deceptively |
00000080  73 69 6d 70 6c 65 20 74  68 72 65 65 20 73 74 61  |simple three sta|
00000090  74 65 20 61 75 74 6f 6d  61 74 6f 6e 2c 20 72 75  |te automaton, ru|
000000a0  6e 20 69 6e 20 74 68 65  20 4d 6f 6f 72 65 0a 20  |n in the Moore. |
000000b0  20 6e 65 69 67 68 62 6f  75 72 68 6f 6f 64 2e 20  | neighbourhood. |
000000c0  54 68 65 20 74 68 72 65  65 20 73 74 61 74 65 73  |The three states|
000000d0  20 61 72 65 20 72 65 66  65 72 72 65 64 20 74 6f  | are referred to|
000000e0  20 61 73 20 27 72 65 61  64 79 27 2c 20 27 66 69  | as 'ready', 'fi|
000000f0  72 69 6e 67 27 20 26 0a  20 20 27 72 65 66 72 61  |ring' &.  'refra|
00000100  63 74 6f 72 79 27 2e 20  41 20 63 65 6c 6c 20 77  |ctory'. A cell w|
00000110  68 69 63 68 20 68 61 73  20 6a 75 73 74 20 66 69  |hich has just fi|
00000120  72 65 64 20 77 69 6c 6c  20 62 65 63 6f 6d 65 20  |red will become |
00000130  72 65 66 72 61 63 74 6f  72 79 20 6f 6e 20 74 68  |refractory on th|
00000140  65 0a 20 20 6e 65 78 74  20 67 65 6e 65 72 61 74  |e.  next generat|
00000150  69 6f 6e 20 26 20 74 68  65 6e 20 72 65 76 65 72  |ion & then rever|
00000160  74 20 74 6f 20 72 65 61  64 79 2e 20 52 65 61 64  |t to ready. Read|
00000170  79 20 63 65 6c 6c 73 20  77 69 6c 6c 20 73 75 62  |y cells will sub|
00000180  73 65 71 75 65 6e 74 6c  79 20 66 69 72 65 0a 20  |sequently fire. |
00000190  20 69 66 20 74 68 65 79  20 68 61 76 65 20 70 72  | if they have pr|
000001a0  65 63 69 73 65 6c 79 20  74 77 6f 20 66 69 72 69  |ecisely two firi|
000001b0  6e 67 20 6e 65 69 67 62  6f 75 72 73 2e 20 54 68  |ng neigbours. Th|
000001c0  69 73 20 72 65 73 75 6c  74 73 20 69 6e 20 70 75  |is results in pu|
000001d0  6c 73 65 73 20 6f 66 0a  20 20 66 69 72 69 6e 67  |lses of.  firing|
000001e0  20 63 65 6c 6c 73 20 64  72 69 66 74 69 6e 67 20  | cells drifting |
000001f0  61 63 72 6f 73 73 20 74  68 65 20 62 72 61 69 6e  |across the brain|
00000200  2c 20 63 6f 6c 6c 69 64  69 6e 67 20 26 20 73 65  |, colliding & se|
00000210  6e 64 69 6e 67 20 6f 66  66 20 73 69 67 6e 61 6c  |nding off signal|
00000220  73 20 69 6e 0a 20 20 6f  74 68 65 72 20 64 69 72  |s in.  other dir|
00000230  65 63 74 69 6f 6e 73 2e  20 41 6e 20 69 6e 69 74  |ections. An init|
00000240  69 61 6c 20 73 6f 75 70  20 71 75 69 63 6b 6c 79  |ial soup quickly|
00000250  20 73 65 74 74 6c 65 73  20 64 6f 77 6e 20 74 6f  | settles down to|
00000260  20 61 20 74 79 70 69 63  61 6c 20 6c 65 76 65 6c  | a typical level|
00000270  0a 20 20 6f 66 20 61 63  74 69 76 69 74 79 2e 20  |.  of activity. |
00000280  54 72 79 20 61 20 77 69  6e 64 6f 77 20 6f 66 20  |Try a window of |
00000290  32 30 30 78 31 30 30 2e  0a 0a 49 4e 49 54 49 41  |200x100...INITIA|
000002a0  4c 49 53 41 54 49 4f 4e  2a 0a 0a 20 20 31 30 44  |LISATION*..  10D|
000002b0  45 46 20 50 52 4f 43 64  6f 0a 20 20 32 30 2a 53  |EF PROCdo.  20*S|
000002c0  65 74 45 76 61 6c 20 77  72 61 70 20 6f 6e 0a 20  |etEval wrap on. |
000002d0  20 33 30 2a 53 65 74 45  76 61 6c 20 72 65 61 64  | 30*SetEval read|
000002e0  79 20 31 32 37 0a 20 20  34 30 2a 53 65 74 45 76  |y 127.  40*SetEv|
000002f0  61 6c 20 66 69 72 69 6e  67 20 39 36 0a 20 20 35  |al firing 96.  5|
00000300  30 2a 53 65 74 45 76 61  6c 20 72 65 66 72 61 63  |0*SetEval refrac|
00000310  74 6f 72 79 20 32 32 0a  20 20 36 30 45 4e 44 50  |tory 22.  60ENDP|
00000320  52 4f 43 0a 0a 53 43 52  45 45 4e 2a 0a 0a 20 20  |ROC..SCREEN*..  |
00000330  31 30 44 45 46 20 50 52  4f 43 64 6f 0a 20 20 32  |10DEF PROCdo.  2|
00000340  30 44 49 4d 20 62 75 66  25 20 32 35 36 3a 53 59  |0DIM buf% 256:SY|
00000350  53 20 22 4f 53 5f 52 65  61 64 56 61 72 56 61 6c  |S "OS_ReadVarVal|
00000360  22 2c 22 72 65 61 64 79  22 2c 62 75 66 25 2c 32  |","ready",buf%,2|
00000370  35 36 3a 72 65 61 3d 21  62 75 66 25 0a 20 20 33  |56:rea=!buf%.  3|
00000380  30 53 59 53 20 22 4f 53  5f 52 65 61 64 56 61 72  |0SYS "OS_ReadVar|
00000390  56 61 6c 22 2c 22 66 69  72 69 6e 67 22 2c 62 75  |Val","firing",bu|
000003a0  66 25 2c 32 35 36 3a 66  69 72 3d 21 62 75 66 25  |f%,256:fir=!buf%|
000003b0  0a 20 20 34 30 53 59 53  20 22 4f 53 5f 52 65 61  |.  40SYS "OS_Rea|
000003c0  64 56 61 72 56 61 6c 22  2c 22 72 65 66 72 61 63  |dVarVal","refrac|
000003d0  74 6f 72 79 22 2c 62 75  66 25 2c 32 35 36 3a 72  |tory",buf%,256:r|
000003e0  65 66 3d 21 62 75 66 25  0a 20 20 35 30 50 52 4f  |ef=!buf%.  50PRO|
000003f0  43 73 6f 75 70 28 72 65  66 2c 31 2c 31 29 0a 20  |Csoup(ref,1,1). |
00000400  20 36 30 50 52 4f 43 73  6f 75 70 28 72 65 61 2c  | 60PROCsoup(rea,|
00000410  31 2c 2e 35 29 3a 50 52  4f 43 73 6f 75 70 28 66  |1,.5):PROCsoup(f|
00000420  69 72 2c 31 2c 2e 33 33  29 0a 20 20 37 30 45 4e  |ir,1,.33).  70EN|
00000430  44 50 52 4f 43 0a 0a 43  4f 44 45 2a 0a 0a 28 20  |DPROC..CODE*..( |
00000440  43 45 4c 4c 20 3c 72 65  61 64 79 3e 20 20 3d 20  |CELL <ready>  = |
00000450  49 46 20 28 52 45 41 44  5f 4e 45 49 47 20 3c 66  |IF (READ_NEIG <f|
00000460  69 72 69 6e 67 3e 20 53  43 4f 55 4e 54 5f 4e 45  |iring> SCOUNT_NE|
00000470  49 47 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |IG.             |
00000480  20 20 20 20 20 20 20 20  20 32 20 3d 20 49 46 20  |         2 = IF |
00000490  28 3c 66 69 72 69 6e 67  3e 20 3d 3d 29 20 3c 72  |(<firing> ==) <r|
000004a0  65 61 64 79 3e 20 3d 3d  29 0a 20 20 43 45 4c 4c  |eady> ==).  CELL|
000004b0  20 3c 66 69 72 69 6e 67  3e 20 3d 20 49 46 20 28  | <firing> = IF (|
000004c0  3c 72 65 66 72 61 63 74  6f 72 79 3e 20 3d 3d 29  |<refractory> ==)|
000004d0  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000004e0  20 20 20 20 20 20 20 3c  72 65 61 64 79 3e 20 20  |       <ready>  |
000004f0  20 20 20 20 3d 3d 20 20  20 20 20 20 20 20 20 20  |    ==          |
00000500  20 20 20 20 20 20 20 20  29 0a 0a 45 4e 44 2a     |        )..END*|
0000050f