home *** CD-ROM | disk | FTP | other *** search
-
- TABLE 2: Commands
-
-
- Procedure Prior stack state Resulting stack state
- {bottom, middle, & top of stack} {bottom, middle, & top of stack}
-
- == ?a ?b n terminates code, returning with value n as new cell state
- IF ?a ?b n empty ?a ?b {conditional execution dependant on n}
- SCOUNT_NEIG ?a ?b n ?a ?b number of neighbours which have state=n
- SCOUNT_ALL ?a ?b n ?a ?b number of local cells which have state=n
- MCOUNT_NEIG ?a n m empty ?a number of neighbours which have n <= state <= m
- MCOUNT_ALL ?a n m empty ?a number of local cells which have n <= state <= m
- SUM_NEIG empty ?a ?b ?a ?b sum of the states of the neighbours
- SUM_ALL empty ?a ?b ?a ?b sum of the states of all the local cells
- 2RND empty ?a ?b ?a ?b random integer from {0,1}
- 4RND empty ?a ?b ?a ?b random integer {0,1,2,3}
- 8RND empty ?a ?b ?a ?b random integer {0,. . .,7}
- 256RND empty ?a ?b ?a ?b random integer {0,. . .,255}
- 2RNDB empty ?a ?b ?a ?b random integer per block from {0,1}; see * below
- 4RNDB empty ?a ?b ?a ?b random integer {0,1,2,3}; see *
- 8RNDB empty ?a ?b ?a ?b random integer {0,. . .,7}; see *
- 256RNDB empty ?a ?b ?a ?b random integer {0,. . .,255}; see *
-
-
- empty indicates that position must/will be free
- ?a, ?b, ?c indicates an unknown value (or possible free location)
- n, m or o indicates the presence of a value
- TRUE has the value -1
- FALSE has the value 0
- neighbours means all cells within the neighbourhood of CELL excluding CELL itself (8 for Moore neighbourhood, 3 for Margolus)
- local cells means all cells within the neighbourhood of CELL including CELL itself (9 for Moore neighbourhood, 4 for Margolus)
- note: the type of neighbourhood required for a particular automaton is specified in the initialisation procedure;
- see table 4
- * for use with Margolus neighbourhood; returns a single random value per 2x2 cell block, as partitioned by the
- alternating grid. Will return the same value for all four cells within a particular block.
- To use a RNDB command you must first set the system variable rndb to TRUE within initialisation; see table 4
-