CA General (CAM Simulator), V1.0 R1                   Date:  09/27/93


by Zoltan Belso and Miklos Vargyas
GNOME Project
Department of Computer Science
Eotvos University
Hungary


I  Introduction

The CAM Simulator program is a general purpose cellular automata simulation 
environment based on CAM-6 (see Toffoli, T. and Margolus, N., Cellular 
Automata Machines, MIT Press (1987), for details). The simulator extends 
the possibilities of CAM-6, but this first version is not fully compatible 
with the original CAM definition.

The main difference is that the simulator supports 8 bit planes. In 
consequence the size of cell state alphabet is 256. This implies a change 
of color map definition (because more colors are required). These bit 
planes can be accessed with no restriction and inspite of this any cell can 
be treated as neighbour.


II  The program

The simulator is an interactive FORTH interpreter. Available words are 
listed in file forth.txt. 
The program requires an IBM compatible computer, MCGA or VGA display and 
about 188 KB of free memory to run. You need about 100Kb room on HD.

To run the system, say CAM foo.fth at the DOS prompt. Alternatively, you 
can start the system interactively by saying CAM at the DOS prompt. In the 
first case CAM loads the file foo.fth, executes it then enters interactive 
mode. In the latter case it gets into interactive mode. Since the program 
is a GNOME product (see file GNOME.TXT) there is no prompt and cursor at 
all. Type always CAPITALS.


examples:

1. Runnig time-tunnel say: CAM TIMETUNE.FTH
   
   - the CAM simulator will run the time-tunnel rule (see Toffoli p52)

        : TIME-TUNNEL CENTER NORTH SOUTH WEST EAST  + + + + { 0 1 1 1 1 0 }
                CENTER' XOR >PLN0 ;
        : ECHO CENTER >PLN1 ;

     (this definition is exactly the same than the original one)

   - the size of the cellular space is 50 times 50

        50 MAXX ! 50 MAXY ! 
   
   - the initial configuration is a 5 times 5 squre of not quiescent cells 
     in the center of the space

        : SQUARE 28 23 DO 28 23 DO I J SETXY 1 >PLN0 1 >PLN1 LOOP LOOP ;

   - the simulation will take 100 steps

        100 STEPS !

   - when it is finished the interpreter says Ok. and enters interactive 
     mode 
     
   - since time-tunnel is a reversible rule (see Toffoli for details) you 
     can run it backward
     to do this type:

        SWAP-A     ( this exchanges bit-plane 0 with bit-plane 1 )
        EXCHANGE   ( this exchanges current and shadow planes )
                   ( see file CHANGES.TXT for further details )
        RUN        ( this comments aren't neccassary to type )
                        
     it will take 100 steps backward so you get back the initial 
     configuration

   - the simulator remains in graphic mode, to switch to text mode type:

        TEXT

   - to exit CAM environment type:

        BYE


2. Running life game say: CAM LIFE.FTH

   - the cam simulator loads the LIFE rule (see Toffoli p20) but it won't 
     run
   - to run it type
   
         RUN

   - it takes 10 step in a 256 times 200 size cellular space starting from 
     a random initial configuration 

   - if you want more (say 10000 steps) say:

        10000 STEPS !
        RUN


3. Running life game from a given initial configuration:

   - initial configuration can be loaded from bmp files, too
     to do this simply type LOADIM image.bmp
     (if you want some changes load the image editor by typing \editor.fth 
     then say EDITIM (for editing details see file FORTH.TXT))
     
   - type CAM at the DOS prompt

   - type
        
        \mlife.fth         ( CAM simulator loads the file mlife.fth )
        LOADIM mouse.bmp   ( CAM loads the file mouse.bmp )
        GRAPH              ( swicth to graphic mode )
        SHOW               ( show loaded image )
        RUN                ( ? )

   - the mlife rule is the following:

        : MLIFE
        CENTERB >PLNBT
        CENTER 0= IF
                8SUM { 0 0 0 1 0 0 0 0 0 } ELSE
                8SUM { 0 0 1 1 0 0 0 0 0 } ENDIF
                >PLN0 ;

     Notice, that only PLN0 is changed, other bit-planes are copied without 
     any change. Question: what happens if CENTERB >PLNBT is omitted? 
     (Help: see CHANGES.TXT)


III Files

    This distribution contains the following files:

    GNOME.TXT    - the GNOME project
    README.TXT   - this file
    FORTH.TXT    - list of implemented FORTH words
    CHANGES.TXT  - differences between CAM-6 and the simulator

    CAM.EXE      - the simulator program

    ASYNC.FTH    - asynchronous deterministic computation (p90)
    DENDRITE.FTH - dendritic growth (p167)
    DEVELOP.FTH  - Poisson updating (p86)
    EDITOR.FTH   - defines simple image editor
    FILLS.FTH    - squre fills
    FRACTAL.FTH  - simple fractal (p132)
    GAS.FTH      - HPP-gas, TM-gas (p123 and p131)
    HGLASS.FTH   - HGLASS (p28)
    LIFE.FTH     - game of life (p20)
    MLIFE.FTH    - game of life with multiple planes
    MARGS.FTH    - defines Margolus neighbourhood (p119)
    PARITY.FTH   - parity rule (p31)
    RAND.FTH     - defines random number generator
    RANDWOLK.FTH - 1D random walk (p106)
    REL.FTH      - defines neighbours 
    RGB.FTH      - defines colors and color maps
    SUMS.FTH     - defines 8SUM, 8SUM', 9SUM etc.
    TIMETUNE.FTH - time tunel (p52)
    TUBEWORM.FTH - tube worm  (p83)
    HODGE.FTH    - hodge-podge machine
    CASE.FTH     - defines CASE statement
             
    (page numbers between parantheses refers to Toffoli's and Margolus' book)


III Further releases

    - full CAM-6 compatibility
    - improved displaying
    - more cells
    - Sun version
    - and more!

    Coming soon!

        SBZ0001 & mico

