<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//en">

<!–Converted with LaTeX2HTML 2022 (Released January 1, 2022) –> <HTML lang="en"> <HEAD> <TITLE>Contents of Compiling &amp; Viewing</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> <META NAME="Generator" CONTENT="LaTeX2HTML v2022">

<LINK REL="STYLESHEET" HREF="tutorial.css">

<LINK REL="next" HREF="node5_mn.html"> <LINK REL="previous" HREF="node3_mn.html"> <LINK REL="up" HREF="tutorial_mn.html"> <LINK REL="next" HREF="node5_mn.html"> </HEAD>

<BODY bgcolor="#ffffff" text="#000000" link="#9944EE" vlink="#0000ff" alink="#00ff00">

<H1><A ID="SECTION00040000000000000000"> Compiling &amp; Viewing</A> </H1>

<P> Suppose the <EM>Cellang 2.0</EM> program for the game of Life that appears in Figure&nbsp;<A HREF="node2_ct.html#simple_life"><IMG ALT="[*]" SRC="crossref.png"></A> is in the file <TT>life</TT>. A compiled version of the code is obtained by doing <TT>cellc life</TT> which places the object code into a file called <TT>a.pe-scam</TT>. The object code is executed and displayed by the <TT>pe-scam</TT> abstract machine via: <PRE> pe-scam -c a.pe-scam -r times -x11 -map life.colors &lt; life.data </PRE> where <TT>life.data</TT> is a data file containing the initial configuration of live cells and <TT>life.colors</TT> contains a suitable color map. An optional parameter, <TT>-f</TT>, is used to indicate which field (starting from 1 for the first field) to use as the value to display for the cells. The <TT>-r</TT> option indicates a file which contains information about which generations to report cell values for.

<P> If the <TT>-r</TT> option is not given then the cell values which have changed will be reported for each generation. A sample time file appears in Figure&nbsp;<A HREF="node3_ct.html#report_times"><IMG ALT="[*]" SRC="crossref.png"></A>. A time file is a list of time indications given one per line. A number indicates a time when the values should be reported, while a ``+'' entry causes these values to be produced at the indicated time intervals. Finally a ``!'' entry determines the time at which the last set of values should be produced and the simulation stops. Note that a time file need not contain a ``!'' entry. In the example, The first set of values (after time 0) is produced at time 50, then at each time thereafter until time 100 at which point no values are reported until time 500 and the simulation stops.

<P> Alternatively, <TT>pe-scam</TT> can just output the cell values which can be filtered and/or viewed with <TT>cellview</TT>. An example of this style of use is: <PRE> cat life.data | pe-scam -r times -o | cellview -x11 -map life.colors -dim 0..63,0..63 </PRE> Where the <TT>-o</TT> option indicates that cell values be written to the standard output. The ``-c a.pe&ndash;scam'' has been left out, since the the codefile is assumed to be ``a.pe-scam'' by default. Note that now, however, the dimensions of the cell universe must be known. By convention, <TT>pe-scam</TT>'s cell universe begins numbering at 0 for each dimension. The size and number of dimensions is implementation dependent (and can be configured at installation time in the current release of the software).

<P>

<DIV class="CENTER"><A ID="Margolus_neighborhood"></A><A ID="177"></A> <TABLE> <CAPTION class="BOTTOM"><STRONG>Figure:</STRONG> Margolus neighborhood</CAPTION> <TR><TD><IMG STYLE="height: 261.66ex; " SRC="img6.png" ALT="

\begin{figure}\begin{center}
\setlength{\unitlength}{3pt}
\begin{picture}(31, ....
.....10){0}
\put(11, -1){\dashbox(10, 10){1}}
\end{picture}\end{center}\end{figure}
"></TD></TR> </TABLE> </DIV>

<P>

<DIV class="CENTER"><A ID="which_Margolus"></A><A ID="327"></A> <TABLE> <CAPTION class="BOTTOM"><STRONG>Figure:</STRONG> The pattern of <TT>which</TT> field values for the Margolus neighborhood</CAPTION> <TR><TD><IMG STYLE="height: 261.66ex; " SRC="img7.png" ALT="

\begin{figure}\begin{center}
\begin{verbatim}
0 1 0 1 0 1 0 1 0 1
2 3 2 3 2 3...
...0 1 0 1 0 1 0 1 0 1
2 3 2 3 2 3 2 3 2 3\end{verbatim}
\end{center}\end{figure}
"></TD></TR> </TABLE> </DIV>

<P>

<HR>

</BODY> </HTML>