<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="jit.conway" module="jit" category="Jitter Math">
	<digest>
		Play Conway's game of life
	</digest>
	<description>
		Performs Conway's Game of Life (a cellular automata function) on incoming 1- or 4-plane character matrices.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Jitter
		</metadata>
		<metadata name="tag">
			Jitter Math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="matrix">
			<digest>
				in
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="matrix">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="matrix">
			<digest>
				out
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="matrix">
			<digest>
				dumpout
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--MOP-->
	<mop matrixinputcount="1" matrixoutputcount="1">
		<matrixoutput name="out" planelink="1" typelink="1" dimlink="1" minplanecount="1" maxplanecount="32" mindimcount="1" maxdimcount="32">
			<types>
				char
			</types>
		</matrixoutput>
	</mop>
	<!--MESSAGES-->
	<jittermethodlist>
		<jittermethod name="bang" />
		<jittermethod name="clear" />
		<jittermethod name="exportattrs" />
		<jittermethod name="exportsummary" />
		<jittermethod name="getattributes" />
		<jittermethod name="getstate" />
		<jittermethod name="jit_matrix" />
		<jittermethod name="importattrs" />
		<jittermethod name="outputmatrix" />
		<jittermethod name="summary" />
	</jittermethodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="birthmark" get="1" set="1" type="int" size="1">
			<digest>
				Newborn cells value
			</digest>
			<description>
				Defines whether newborn cells are set to 255 (off) or to the average of the contributing neighbor cells (on) (default = 0).
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Birthmark" />
			</attributelist>
		</attribute>
		<attribute name="deathmask" get="1" set="1" type="int" size="9">
			<digest>
				Dead-to-live cell mask
			</digest>
			<description>
				A mask setting whether a given number of live (non-0) neighbors will make a dead (0) cell come to life (default = 0 0 0 1 0 0 0 0 0). The first element in the list is the mask value for 0 live neighbors.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Death Mask" />
			</attributelist>
		</attribute>
		<attribute name="lifemask" get="1" set="1" type="int" size="9">
			<digest>
				Keep-alive mask
			</digest>
			<description>
				A mask setting whether a given number of live (non-0) neighbors will keep a live (non-0) cell alive (default = 0 0 1 1 0 0 0 0 0). The first element in the list is the mask value for 0 live neighbors.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Life Mask" />
			</attributelist>
		</attribute>
		<attribute name="neighborhood" get="1" set="1" type="int" size="8">
			<digest>
				Neighbor selection mask
			</digest>
			<description>
				A mask for which neighbors around a cell are tallied to determine whether the cell changes state (default = 1 1 1 1 1 1 1 1). Ordering is upper-left, upper, upper-right, left, right, lower-left, lower, lower-right.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Neighborhood" />
			</attributelist>
		</attribute>
	</attributelist>
	<jitterattributelist>
		<jitterattribute name="outputmode" />
		<jitterattribute name="adapt" />
		<jitterattribute name="out_name" />
		<jitterattribute name="type" />
		<jitterattribute name="dim" />
		<jitterattribute name="planecount" />
	</jitterattributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="jit.conway.png" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="jit.linden" />
		<seealso name="jitterchapter17" module="jit" type="tutorial" />
	</seealsolist>
	<discussion>
		<p>
			Devised by mathematician John Conway (1937-), the Game of Life treats the cells that comprise a matrix as either dead (0) or alive (non-0). The matrix is then modified according to the following rules:
		</p>
		<p>
			If a live (non-0) cell has two or three neighbors, it remains alive. otherwise it dies (becomes 0).
		</p>
		<p>
			If a dead cell has exactly three neighbors it becomes alive (255). otherwise it stays dead.
		</p>
		<p>
			The <o>jit.conway</o> object works on 1- and 4-plane char data. It is usually used in a matrix feedback network so that multiple generations of the game can be calculated (see the help patch for details). The <o>jit.conway</o> object treats the incoming matrix as a torus space (i.e. the top wraps to the bottom and the left wraps to the right), so that cells can travel off one edge of the matrix and reappear on the opposite edge.
		</p>
	</discussion>
</c74object>
