Home » Archimedes archive » Archimedes World » AW-1992-03.adf » AWMar92 » !AWMar92/Goodies/ArcAut/Info/Table4

!AWMar92/Goodies/ArcAut/Info/Table4

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 » Archimedes World » AW-1992-03.adf » AWMar92
Filename: !AWMar92/Goodies/ArcAut/Info/Table4
Read OK:
File size: 0DBD bytes
Load address: 0000
Exec address: 0000
File contents
 TABLE 4: Initialisation of parameters


  There is an as yet unresolved problem concerning what happens at the edge of the CA universe, where cells apparently don't
always have the full complement of neighbours.
  ArcAut allows two solutions. We can either identify the left hand edge with the right hand edge, as if they were side by side,
& similarly, the top with the bottom. The result is that we no longer have any edges to worry about! The window effectively
corresponds to the surface of a torus or doughnut (the sort with a hole in the middle). The other possibility is to let the
automaton behave as if the border of cells surrounding the window do exist, but are forced to maintain a fixed state. This is
used in the current definition of 'Life'. It is a useful facility if we want to prevent 'objects' such as gliders, wandering off one side of the window, only to reappear on the other, & then go & interfere with whatever is happening in the centre.


  Name of system variable      Possible values       Default value         Meaning

          wrap                 on|off                on                    selects whether the CA universe has wrap-around or
                                                                           is bordered by cells of a fixed state
        border                 {0,1,. . .,255}       no default            specifies cell state for border; used when wrap=off
          neig                 moore|margolus        moore                 selects the type of neighbourhood required by the
                                                                           automaton; see table 3
          flag                 0|3|4|7               0                     used when neig=margolus; specifies whether automaton
                                                                           code register FLAG should return:
                                                                   0                                                  ;if flag=0
                                                                   0|1|2|3 depending on CELL's position within block
                                                                           0 for UL, 1 for UR, 2 for LL, 3 for LR     ;if flag=3
                                                                   0|4     depending on the phase
                                                                           0 for even phase, 4 for odd phase          ;if flag=4
                                                                   0 to 7  the sum of the above two items             ;if flag=7
                                                                           see table 3
          rndb                 on|off                off                   when neig=margolus & automaton requires use of the
                                                                           RNDB command, you must set rndb to on;
                                                                           see tables 2 & 3 and example DLA automaton

  To set any of these values include a command, for example '*SetEval wrap off', within the body of the procedure called do, in
the section of text between INITIALISATION* & SCREEN* ; see some of the automatons provided for examples.
  You may also use this procedure to allow the user to input parameters needed by your automaton; note, these must also be passed to the rest of the automaton via system variables. See for example the automatons Demon & FracGrow.
00000000  0a 20 54 41 42 4c 45 20  34 3a 20 49 6e 69 74 69  |. TABLE 4: Initi|
00000010  61 6c 69 73 61 74 69 6f  6e 20 6f 66 20 70 61 72  |alisation of par|
00000020  61 6d 65 74 65 72 73 0a  0a 0a 20 20 54 68 65 72  |ameters...  Ther|
00000030  65 20 69 73 20 61 6e 20  61 73 20 79 65 74 20 75  |e is an as yet u|
00000040  6e 72 65 73 6f 6c 76 65  64 20 70 72 6f 62 6c 65  |nresolved proble|
00000050  6d 20 63 6f 6e 63 65 72  6e 69 6e 67 20 77 68 61  |m concerning wha|
00000060  74 20 68 61 70 70 65 6e  73 20 61 74 20 74 68 65  |t happens at the|
00000070  20 65 64 67 65 20 6f 66  20 74 68 65 20 43 41 20  | edge of the CA |
00000080  75 6e 69 76 65 72 73 65  2c 20 77 68 65 72 65 20  |universe, where |
00000090  63 65 6c 6c 73 20 61 70  70 61 72 65 6e 74 6c 79  |cells apparently|
000000a0  20 64 6f 6e 27 74 0a 61  6c 77 61 79 73 20 68 61  | don't.always ha|
000000b0  76 65 20 74 68 65 20 66  75 6c 6c 20 63 6f 6d 70  |ve the full comp|
000000c0  6c 65 6d 65 6e 74 20 6f  66 20 6e 65 69 67 68 62  |lement of neighb|
000000d0  6f 75 72 73 2e 0a 20 20  41 72 63 41 75 74 20 61  |ours..  ArcAut a|
000000e0  6c 6c 6f 77 73 20 74 77  6f 20 73 6f 6c 75 74 69  |llows two soluti|
000000f0  6f 6e 73 2e 20 57 65 20  63 61 6e 20 65 69 74 68  |ons. We can eith|
00000100  65 72 20 69 64 65 6e 74  69 66 79 20 74 68 65 20  |er identify the |
00000110  6c 65 66 74 20 68 61 6e  64 20 65 64 67 65 20 77  |left hand edge w|
00000120  69 74 68 20 74 68 65 20  72 69 67 68 74 20 68 61  |ith the right ha|
00000130  6e 64 20 65 64 67 65 2c  20 61 73 20 69 66 20 74  |nd edge, as if t|
00000140  68 65 79 20 77 65 72 65  20 73 69 64 65 20 62 79  |hey were side by|
00000150  20 73 69 64 65 2c 0a 26  20 73 69 6d 69 6c 61 72  | side,.& similar|
00000160  6c 79 2c 20 74 68 65 20  74 6f 70 20 77 69 74 68  |ly, the top with|
00000170  20 74 68 65 20 62 6f 74  74 6f 6d 2e 20 54 68 65  | the bottom. The|
00000180  20 72 65 73 75 6c 74 20  69 73 20 74 68 61 74 20  | result is that |
00000190  77 65 20 6e 6f 20 6c 6f  6e 67 65 72 20 68 61 76  |we no longer hav|
000001a0  65 20 61 6e 79 20 65 64  67 65 73 20 74 6f 20 77  |e any edges to w|
000001b0  6f 72 72 79 20 61 62 6f  75 74 21 20 54 68 65 20  |orry about! The |
000001c0  77 69 6e 64 6f 77 20 65  66 66 65 63 74 69 76 65  |window effective|
000001d0  6c 79 0a 63 6f 72 72 65  73 70 6f 6e 64 73 20 74  |ly.corresponds t|
000001e0  6f 20 74 68 65 20 73 75  72 66 61 63 65 20 6f 66  |o the surface of|
000001f0  20 61 20 74 6f 72 75 73  20 6f 72 20 64 6f 75 67  | a torus or doug|
00000200  68 6e 75 74 20 28 74 68  65 20 73 6f 72 74 20 77  |hnut (the sort w|
00000210  69 74 68 20 61 20 68 6f  6c 65 20 69 6e 20 74 68  |ith a hole in th|
00000220  65 20 6d 69 64 64 6c 65  29 2e 20 54 68 65 20 6f  |e middle). The o|
00000230  74 68 65 72 20 70 6f 73  73 69 62 69 6c 69 74 79  |ther possibility|
00000240  20 69 73 20 74 6f 20 6c  65 74 20 74 68 65 0a 61  | is to let the.a|
00000250  75 74 6f 6d 61 74 6f 6e  20 62 65 68 61 76 65 20  |utomaton behave |
00000260  61 73 20 69 66 20 74 68  65 20 62 6f 72 64 65 72  |as if the border|
00000270  20 6f 66 20 63 65 6c 6c  73 20 73 75 72 72 6f 75  | of cells surrou|
00000280  6e 64 69 6e 67 20 74 68  65 20 77 69 6e 64 6f 77  |nding the window|
00000290  20 64 6f 20 65 78 69 73  74 2c 20 62 75 74 20 61  | do exist, but a|
000002a0  72 65 20 66 6f 72 63 65  64 20 74 6f 20 6d 61 69  |re forced to mai|
000002b0  6e 74 61 69 6e 20 61 20  66 69 78 65 64 20 73 74  |ntain a fixed st|
000002c0  61 74 65 2e 20 54 68 69  73 20 69 73 0a 75 73 65  |ate. This is.use|
000002d0  64 20 69 6e 20 74 68 65  20 63 75 72 72 65 6e 74  |d in the current|
000002e0  20 64 65 66 69 6e 69 74  69 6f 6e 20 6f 66 20 27  | definition of '|
000002f0  4c 69 66 65 27 2e 20 49  74 20 69 73 20 61 20 75  |Life'. It is a u|
00000300  73 65 66 75 6c 20 66 61  63 69 6c 69 74 79 20 69  |seful facility i|
00000310  66 20 77 65 20 77 61 6e  74 20 74 6f 20 70 72 65  |f we want to pre|
00000320  76 65 6e 74 20 27 6f 62  6a 65 63 74 73 27 20 73  |vent 'objects' s|
00000330  75 63 68 20 61 73 20 67  6c 69 64 65 72 73 2c 20  |uch as gliders, |
00000340  77 61 6e 64 65 72 69 6e  67 20 6f 66 66 20 6f 6e  |wandering off on|
00000350  65 20 73 69 64 65 20 6f  66 20 74 68 65 20 77 69  |e side of the wi|
00000360  6e 64 6f 77 2c 20 6f 6e  6c 79 20 74 6f 20 72 65  |ndow, only to re|
00000370  61 70 70 65 61 72 20 6f  6e 20 74 68 65 20 6f 74  |appear on the ot|
00000380  68 65 72 2c 20 26 20 74  68 65 6e 20 67 6f 20 26  |her, & then go &|
00000390  20 69 6e 74 65 72 66 65  72 65 20 77 69 74 68 20  | interfere with |
000003a0  77 68 61 74 65 76 65 72  20 69 73 20 68 61 70 70  |whatever is happ|
000003b0  65 6e 69 6e 67 20 69 6e  20 74 68 65 20 63 65 6e  |ening in the cen|
000003c0  74 72 65 2e 0a 0a 0a 20  20 4e 61 6d 65 20 6f 66  |tre....  Name of|
000003d0  20 73 79 73 74 65 6d 20  76 61 72 69 61 62 6c 65  | system variable|
000003e0  20 20 20 20 20 20 50 6f  73 73 69 62 6c 65 20 76  |      Possible v|
000003f0  61 6c 75 65 73 20 20 20  20 20 20 20 44 65 66 61  |alues       Defa|
00000400  75 6c 74 20 76 61 6c 75  65 20 20 20 20 20 20 20  |ult value       |
00000410  20 20 4d 65 61 6e 69 6e  67 0a 0a 20 20 20 20 20  |  Meaning..     |
00000420  20 20 20 20 20 77 72 61  70 20 20 20 20 20 20 20  |     wrap       |
00000430  20 20 20 20 20 20 20 20  20 20 6f 6e 7c 6f 66 66  |          on|off|
00000440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000450  6f 6e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |on              |
00000460  20 20 20 20 20 20 73 65  6c 65 63 74 73 20 77 68  |      selects wh|
00000470  65 74 68 65 72 20 74 68  65 20 43 41 20 75 6e 69  |ether the CA uni|
00000480  76 65 72 73 65 20 68 61  73 20 77 72 61 70 2d 61  |verse has wrap-a|
00000490  72 6f 75 6e 64 20 6f 72  0a 20 20 20 20 20 20 20  |round or.       |
000004a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000004e0  20 20 20 20 69 73 20 62  6f 72 64 65 72 65 64 20  |    is bordered |
000004f0  62 79 20 63 65 6c 6c 73  20 6f 66 20 61 20 66 69  |by cells of a fi|
00000500  78 65 64 20 73 74 61 74  65 0a 20 20 20 20 20 20  |xed state.      |
00000510  20 20 62 6f 72 64 65 72  20 20 20 20 20 20 20 20  |  border        |
00000520  20 20 20 20 20 20 20 20  20 7b 30 2c 31 2c 2e 20  |         {0,1,. |
00000530  2e 20 2e 2c 32 35 35 7d  20 20 20 20 20 20 20 6e  |. .,255}       n|
00000540  6f 20 64 65 66 61 75 6c  74 20 20 20 20 20 20 20  |o default       |
00000550  20 20 20 20 20 73 70 65  63 69 66 69 65 73 20 63  |     specifies c|
00000560  65 6c 6c 20 73 74 61 74  65 20 66 6f 72 20 62 6f  |ell state for bo|
00000570  72 64 65 72 3b 20 75 73  65 64 20 77 68 65 6e 20  |rder; used when |
00000580  77 72 61 70 3d 6f 66 66  0a 20 20 20 20 20 20 20  |wrap=off.       |
00000590  20 20 20 6e 65 69 67 20  20 20 20 20 20 20 20 20  |   neig         |
000005a0  20 20 20 20 20 20 20 20  6d 6f 6f 72 65 7c 6d 61  |        moore|ma|
000005b0  72 67 6f 6c 75 73 20 20  20 20 20 20 20 20 6d 6f  |rgolus        mo|
000005c0  6f 72 65 20 20 20 20 20  20 20 20 20 20 20 20 20  |ore             |
000005d0  20 20 20 20 73 65 6c 65  63 74 73 20 74 68 65 20  |    selects the |
000005e0  74 79 70 65 20 6f 66 20  6e 65 69 67 68 62 6f 75  |type of neighbou|
000005f0  72 68 6f 6f 64 20 72 65  71 75 69 72 65 64 20 62  |rhood required b|
00000600  79 20 74 68 65 0a 20 20  20 20 20 20 20 20 20 20  |y the.          |
00000610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000650  20 61 75 74 6f 6d 61 74  6f 6e 3b 20 73 65 65 20  | automaton; see |
00000660  74 61 62 6c 65 20 33 0a  20 20 20 20 20 20 20 20  |table 3.        |
00000670  20 20 66 6c 61 67 20 20  20 20 20 20 20 20 20 20  |  flag          |
00000680  20 20 20 20 20 20 20 30  7c 33 7c 34 7c 37 20 20  |       0|3|4|7  |
00000690  20 20 20 20 20 20 20 20  20 20 20 20 20 30 20 20  |             0  |
000006a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000006b0  20 20 20 75 73 65 64 20  77 68 65 6e 20 6e 65 69  |   used when nei|
000006c0  67 3d 6d 61 72 67 6f 6c  75 73 3b 20 73 70 65 63  |g=margolus; spec|
000006d0  69 66 69 65 73 20 77 68  65 74 68 65 72 20 61 75  |ifies whether au|
000006e0  74 6f 6d 61 74 6f 6e 0a  20 20 20 20 20 20 20 20  |tomaton.        |
000006f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000730  20 20 20 63 6f 64 65 20  72 65 67 69 73 74 65 72  |   code register|
00000740  20 46 4c 41 47 20 73 68  6f 75 6c 64 20 72 65 74  | FLAG should ret|
00000750  75 72 6e 3a 0a 20 20 20  20 20 20 20 20 20 20 20  |urn:.           |
00000760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000790  20 20 20 20 20 20 20 20  30 20 20 20 20 20 20 20  |        0       |
000007a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000007c0  20 20 20 20 20 20 20 20  20 20 20 3b 69 66 20 66  |           ;if f|
000007d0  6c 61 67 3d 30 0a 20 20  20 20 20 20 20 20 20 20  |lag=0.          |
000007e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000810  20 20 20 20 20 20 20 20  20 30 7c 31 7c 32 7c 33  |         0|1|2|3|
00000820  20 64 65 70 65 6e 64 69  6e 67 20 6f 6e 20 43 45  | depending on CE|
00000830  4c 4c 27 73 20 70 6f 73  69 74 69 6f 6e 20 77 69  |LL's position wi|
00000840  74 68 69 6e 20 62 6c 6f  63 6b 0a 20 20 20 20 20  |thin block.     |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000890  20 20 20 20 20 20 30 20  66 6f 72 20 55 4c 2c 20  |      0 for UL, |
000008a0  31 20 66 6f 72 20 55 52  2c 20 32 20 66 6f 72 20  |1 for UR, 2 for |
000008b0  4c 4c 2c 20 33 20 66 6f  72 20 4c 52 20 20 20 20  |LL, 3 for LR    |
000008c0  20 3b 69 66 20 66 6c 61  67 3d 33 0a 20 20 20 20  | ;if flag=3.    |
000008d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 30  |               0|
00000910  7c 34 20 20 20 20 20 64  65 70 65 6e 64 69 6e 67  ||4     depending|
00000920  20 6f 6e 20 74 68 65 20  70 68 61 73 65 0a 20 20  | on the phase.  |
00000930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000970  20 20 20 20 20 20 20 20  20 30 20 66 6f 72 20 65  |         0 for e|
00000980  76 65 6e 20 70 68 61 73  65 2c 20 34 20 66 6f 72  |ven phase, 4 for|
00000990  20 6f 64 64 20 70 68 61  73 65 20 20 20 20 20 20  | odd phase      |
000009a0  20 20 20 20 3b 69 66 20  66 6c 61 67 3d 34 0a 20  |    ;if flag=4. |
000009b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000009f0  20 20 30 20 74 6f 20 37  20 20 74 68 65 20 73 75  |  0 to 7  the su|
00000a00  6d 20 6f 66 20 74 68 65  20 61 62 6f 76 65 20 74  |m of the above t|
00000a10  77 6f 20 69 74 65 6d 73  20 20 20 20 20 20 20 20  |wo items        |
00000a20  20 20 20 20 20 3b 69 66  20 66 6c 61 67 3d 37 0a  |     ;if flag=7.|
00000a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000a70  20 20 20 20 20 20 20 20  20 20 20 73 65 65 20 74  |           see t|
00000a80  61 62 6c 65 20 33 0a 20  20 20 20 20 20 20 20 20  |able 3.         |
00000a90  20 72 6e 64 62 20 20 20  20 20 20 20 20 20 20 20  | rndb           |
00000aa0  20 20 20 20 20 20 6f 6e  7c 6f 66 66 20 20 20 20  |      on|off    |
00000ab0  20 20 20 20 20 20 20 20  20 20 20 20 6f 66 66 20  |            off |
00000ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ad0  20 20 77 68 65 6e 20 6e  65 69 67 3d 6d 61 72 67  |  when neig=marg|
00000ae0  6f 6c 75 73 20 26 20 61  75 74 6f 6d 61 74 6f 6e  |olus & automaton|
00000af0  20 72 65 71 75 69 72 65  73 20 75 73 65 20 6f 66  | requires use of|
00000b00  20 74 68 65 0a 20 20 20  20 20 20 20 20 20 20 20  | the.           |
00000b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000b50  52 4e 44 42 20 63 6f 6d  6d 61 6e 64 2c 20 79 6f  |RNDB command, yo|
00000b60  75 20 6d 75 73 74 20 73  65 74 20 72 6e 64 62 20  |u must set rndb |
00000b70  74 6f 20 6f 6e 3b 0a 20  20 20 20 20 20 20 20 20  |to on;.         |
00000b80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000bc0  20 20 73 65 65 20 74 61  62 6c 65 73 20 32 20 26  |  see tables 2 &|
00000bd0  20 33 20 61 6e 64 20 65  78 61 6d 70 6c 65 20 44  | 3 and example D|
00000be0  4c 41 20 61 75 74 6f 6d  61 74 6f 6e 0a 0a 20 20  |LA automaton..  |
00000bf0  54 6f 20 73 65 74 20 61  6e 79 20 6f 66 20 74 68  |To set any of th|
00000c00  65 73 65 20 76 61 6c 75  65 73 20 69 6e 63 6c 75  |ese values inclu|
00000c10  64 65 20 61 20 63 6f 6d  6d 61 6e 64 2c 20 66 6f  |de a command, fo|
00000c20  72 20 65 78 61 6d 70 6c  65 20 27 2a 53 65 74 45  |r example '*SetE|
00000c30  76 61 6c 20 77 72 61 70  20 6f 66 66 27 2c 20 77  |val wrap off', w|
00000c40  69 74 68 69 6e 20 74 68  65 20 62 6f 64 79 20 6f  |ithin the body o|
00000c50  66 20 74 68 65 20 70 72  6f 63 65 64 75 72 65 20  |f the procedure |
00000c60  63 61 6c 6c 65 64 20 64  6f 2c 20 69 6e 0a 74 68  |called do, in.th|
00000c70  65 20 73 65 63 74 69 6f  6e 20 6f 66 20 74 65 78  |e section of tex|
00000c80  74 20 62 65 74 77 65 65  6e 20 49 4e 49 54 49 41  |t between INITIA|
00000c90  4c 49 53 41 54 49 4f 4e  2a 20 26 20 53 43 52 45  |LISATION* & SCRE|
00000ca0  45 4e 2a 20 3b 20 73 65  65 20 73 6f 6d 65 20 6f  |EN* ; see some o|
00000cb0  66 20 74 68 65 20 61 75  74 6f 6d 61 74 6f 6e 73  |f the automatons|
00000cc0  20 70 72 6f 76 69 64 65  64 20 66 6f 72 20 65 78  | provided for ex|
00000cd0  61 6d 70 6c 65 73 2e 0a  20 20 59 6f 75 20 6d 61  |amples..  You ma|
00000ce0  79 20 61 6c 73 6f 20 75  73 65 20 74 68 69 73 20  |y also use this |
00000cf0  70 72 6f 63 65 64 75 72  65 20 74 6f 20 61 6c 6c  |procedure to all|
00000d00  6f 77 20 74 68 65 20 75  73 65 72 20 74 6f 20 69  |ow the user to i|
00000d10  6e 70 75 74 20 70 61 72  61 6d 65 74 65 72 73 20  |nput parameters |
00000d20  6e 65 65 64 65 64 20 62  79 20 79 6f 75 72 20 61  |needed by your a|
00000d30  75 74 6f 6d 61 74 6f 6e  3b 20 6e 6f 74 65 2c 20  |utomaton; note, |
00000d40  74 68 65 73 65 20 6d 75  73 74 20 61 6c 73 6f 20  |these must also |
00000d50  62 65 20 70 61 73 73 65  64 20 74 6f 20 74 68 65  |be passed to the|
00000d60  20 72 65 73 74 20 6f 66  20 74 68 65 20 61 75 74  | rest of the aut|
00000d70  6f 6d 61 74 6f 6e 20 76  69 61 20 73 79 73 74 65  |omaton via syste|
00000d80  6d 20 76 61 72 69 61 62  6c 65 73 2e 20 53 65 65  |m variables. See|
00000d90  20 66 6f 72 20 65 78 61  6d 70 6c 65 20 74 68 65  | for example the|
00000da0  20 61 75 74 6f 6d 61 74  6f 6e 73 20 44 65 6d 6f  | automatons Demo|
00000db0  6e 20 26 20 46 72 61 63  47 72 6f 77 2e           |n & FracGrow.|
00000dbd