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

!AWJan92/Goodies/ArcAut/Automatons/FgtMeNot

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/FgtMeNot
Read OK:
File size: 02E9 bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  Forget_Me_Not

  A very simple Margolus neighbourhood two state automaton. This is a good
  example of a reversible automaton which is self inverse; after running the
  automaton for a few generations halt it, click on the phase option & then
  continue - you will see the automaton run backwards!

INITIALISATION*

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

SCREEN*

  10DEF PROCdo
  20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:x%=!buf%/2
  30SYS "OS_ReadVarVal","suy",buf%,256:y%=!buf%/2
  40k%=RND(2*x%*.2):f%=((x%AND1ANDNOT(y%AND1))OR(y%AND1ANDNOT(x%AND1)))
  50GCOL 63 TINT 255:RECTANGLE FILL -k%*4+f%*4,-k%*4,k%*8-2,k%*8-2
  60ENDPROC

CODE*

( READ_NEIG
  CCW OPP EOR CW EOR == )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 46 6f  |AUTOMATON*..  Fo|
00000010  72 67 65 74 5f 4d 65 5f  4e 6f 74 0a 0a 20 20 41  |rget_Me_Not..  A|
00000020  20 76 65 72 79 20 73 69  6d 70 6c 65 20 4d 61 72  | very simple Mar|
00000030  67 6f 6c 75 73 20 6e 65  69 67 68 62 6f 75 72 68  |golus neighbourh|
00000040  6f 6f 64 20 74 77 6f 20  73 74 61 74 65 20 61 75  |ood two state au|
00000050  74 6f 6d 61 74 6f 6e 2e  20 54 68 69 73 20 69 73  |tomaton. This is|
00000060  20 61 20 67 6f 6f 64 0a  20 20 65 78 61 6d 70 6c  | a good.  exampl|
00000070  65 20 6f 66 20 61 20 72  65 76 65 72 73 69 62 6c  |e of a reversibl|
00000080  65 20 61 75 74 6f 6d 61  74 6f 6e 20 77 68 69 63  |e automaton whic|
00000090  68 20 69 73 20 73 65 6c  66 20 69 6e 76 65 72 73  |h is self invers|
000000a0  65 3b 20 61 66 74 65 72  20 72 75 6e 6e 69 6e 67  |e; after running|
000000b0  20 74 68 65 0a 20 20 61  75 74 6f 6d 61 74 6f 6e  | the.  automaton|
000000c0  20 66 6f 72 20 61 20 66  65 77 20 67 65 6e 65 72  | for a few gener|
000000d0  61 74 69 6f 6e 73 20 68  61 6c 74 20 69 74 2c 20  |ations halt it, |
000000e0  63 6c 69 63 6b 20 6f 6e  20 74 68 65 20 70 68 61  |click on the pha|
000000f0  73 65 20 6f 70 74 69 6f  6e 20 26 20 74 68 65 6e  |se option & then|
00000100  0a 20 20 63 6f 6e 74 69  6e 75 65 20 2d 20 79 6f  |.  continue - yo|
00000110  75 20 77 69 6c 6c 20 73  65 65 20 74 68 65 20 61  |u will see the a|
00000120  75 74 6f 6d 61 74 6f 6e  20 72 75 6e 20 62 61 63  |utomaton run bac|
00000130  6b 77 61 72 64 73 21 0a  0a 49 4e 49 54 49 41 4c  |kwards!..INITIAL|
00000140  49 53 41 54 49 4f 4e 2a  0a 0a 20 20 31 30 44 45  |ISATION*..  10DE|
00000150  46 20 50 52 4f 43 64 6f  0a 20 20 32 30 2a 53 65  |F PROCdo.  20*Se|
00000160  74 45 76 61 6c 20 77 72  61 70 20 6f 6e 0a 20 20  |tEval wrap on.  |
00000170  33 30 2a 53 65 74 45 76  61 6c 20 6e 65 69 67 20  |30*SetEval neig |
00000180  6d 61 72 67 6f 6c 75 73  0a 20 20 34 30 45 4e 44  |margolus.  40END|
00000190  50 52 4f 43 0a 0a 53 43  52 45 45 4e 2a 0a 0a 20  |PROC..SCREEN*.. |
000001a0  20 31 30 44 45 46 20 50  52 4f 43 64 6f 0a 20 20  | 10DEF PROCdo.  |
000001b0  32 30 44 49 4d 20 62 75  66 25 20 32 35 36 3a 53  |20DIM buf% 256:S|
000001c0  59 53 20 22 4f 53 5f 52  65 61 64 56 61 72 56 61  |YS "OS_ReadVarVa|
000001d0  6c 22 2c 22 73 75 78 22  2c 62 75 66 25 2c 32 35  |l","sux",buf%,25|
000001e0  36 3a 78 25 3d 21 62 75  66 25 2f 32 0a 20 20 33  |6:x%=!buf%/2.  3|
000001f0  30 53 59 53 20 22 4f 53  5f 52 65 61 64 56 61 72  |0SYS "OS_ReadVar|
00000200  56 61 6c 22 2c 22 73 75  79 22 2c 62 75 66 25 2c  |Val","suy",buf%,|
00000210  32 35 36 3a 79 25 3d 21  62 75 66 25 2f 32 0a 20  |256:y%=!buf%/2. |
00000220  20 34 30 6b 25 3d 52 4e  44 28 32 2a 78 25 2a 2e  | 40k%=RND(2*x%*.|
00000230  32 29 3a 66 25 3d 28 28  78 25 41 4e 44 31 41 4e  |2):f%=((x%AND1AN|
00000240  44 4e 4f 54 28 79 25 41  4e 44 31 29 29 4f 52 28  |DNOT(y%AND1))OR(|
00000250  79 25 41 4e 44 31 41 4e  44 4e 4f 54 28 78 25 41  |y%AND1ANDNOT(x%A|
00000260  4e 44 31 29 29 29 0a 20  20 35 30 47 43 4f 4c 20  |ND1))).  50GCOL |
00000270  36 33 20 54 49 4e 54 20  32 35 35 3a 52 45 43 54  |63 TINT 255:RECT|
00000280  41 4e 47 4c 45 20 46 49  4c 4c 20 2d 6b 25 2a 34  |ANGLE FILL -k%*4|
00000290  2b 66 25 2a 34 2c 2d 6b  25 2a 34 2c 6b 25 2a 38  |+f%*4,-k%*4,k%*8|
000002a0  2d 32 2c 6b 25 2a 38 2d  32 0a 20 20 36 30 45 4e  |-2,k%*8-2.  60EN|
000002b0  44 50 52 4f 43 0a 0a 43  4f 44 45 2a 0a 0a 28 20  |DPROC..CODE*..( |
000002c0  52 45 41 44 5f 4e 45 49  47 0a 20 20 43 43 57 20  |READ_NEIG.  CCW |
000002d0  4f 50 50 20 45 4f 52 20  43 57 20 45 4f 52 20 3d  |OPP EOR CW EOR =|
000002e0  3d 20 29 0a 0a 45 4e 44  2a                       |= )..END*|
000002e9