\documentclass[a4paper,12pt]{article}
\usepackage{listings}

\title{ZhenCo FS HolyDesign II \\ Specification}
\date{ December 2, 2070}
\author{Amras}

\begin{document}
	\maketitle
	\newpage
	\section*{Overview}
		The ZhenCo Feng Shui HolyDesign Constructor is a dynamic and responsive standard for the creation of efficient and parametric environments of worship and meditation. The ZhenCo standard is ideal for densely populated regions as well as inhospitable and unmanned extraterrestrial missions.
	\section*{Coloration}
		We utilize eight important colors both to assist automation and to restrict or appease ectoplasmic remnants (coloquially, ghosts).
		\begin{itemize}
			\item White [w]
			\item Red [r]
			\item Orange [o]
			\item Yellow [y]
			\item Green [g]
			\item Blue [b]
			\item Indigo [i]
			\item Violet [v]
		\end{itemize}
		Each ectoplasmic remnant has a color they will avoid at all costs. The ZhenCo proprietary Ectoplasmic Interface tints any remnants with their specific hue to aid users in appropriate design.
	\section*{Command Syntax}
		Each command consists of a \textbf{requirement} and an \textbf{action}. For instance, we may wish to request all \textit{red} tiles turn \textit{blue}. We will use $r$ as the requirement and $b$ as the action \\
\texttt{r -> b    \# turn all red tiles blue}
		\subsection*{Requirement}
		The \textbf{requirement} can contain any of the following symbols: \\
		\begin{tabular}{l | l}
			t, f & respectively true and false. t always satisfies a requirement, f never does. \\
			w,r,o,y,g,b,i,v& check that the tile is of a given color \\
			( )& allow for organization of other statements \\
			!& NOT. Inverts whatever follows. \\
			\&& an AND operator. Conditions on both sides must be met to satisfy. \\
			$|$& an OR operator. Either condition must be met. \\
			$<$, $>$, $=$&coupled with either a digit(0-9) or a letter (A-I) \\
			& is satisfied by all tiles left, right, or on the index specified, respectively.\\
			\%& MODULO, followed by a digit/letter is satisfied by all multiples of the index. \\
			\% $+$& a MODULO expression followed by a $+$ is satisfied by offset multiples. \\
		\end{tabular}

\paragraph{} Some examples: \\
\texttt{
t-> w........\# turn all tiles white \\
f -> g.......\# has no effect \\
r|g -> b.....\# turn all red and green tiles blue \\
(r|g)\&!<B->v \# all red/green tiles not on the left of B turn violet\\
\%C -> i......\# every third column turns indigo \\
\%2+1 -> y....\# turn all odd rows yellow \\
=C\&=2 -> o...\# turn the tile C2 orange \\
C\&2 -> o.....\# shorthand for the above \\
}
		
		\subsection*{Action}
		The \textbf{action} can contain the following commands: \\
		\begin{tabular}{l | l}
			w,r,o,y,g,b,i,v&color the tiles with the specified color \\
			\$wall&create and dynamically connect a wall in all specified tiles \\
			\$door&create a door in any valid tile, between two walls or doors.\\
			\$open&open any doors in the specified area \\
			\$close&close any doors in the specified area \\
			\$kill&a digital exorcism destroys all ghosts in the area \\
			\&&apply multiple actions seperated by \&
		\end{tabular}
		
		\paragraph{} Examples: \\
\texttt{
=3 -> \$wall........\# create a wall across the third row \\
=3\&=G -> \$door.....\# create a door in the tile G3 \\
r -> \$open.........\# open all doors on red tiles \\
A\&7 -> \$door\&\$open \# create and open a door at once
}

\section*{Ectoplasmic Remnants}
\subsection*{Psychology}
A remnant (ie. ghost) will always try to find the nearest \textit{reachable} shrine of its color. Failing that, it will travel with no sense of direction. Should multiple shrines be available, all ghosts will show a preference towards a specific one. Experimentation may be needed to determine their preference.

A remnant will never float across a square of its own color. The reason for this distaste is unknown, but the disgust can be utilized by a skilled designer.
\subsection*{Merging}
When two ghosts of varying colors \textbf{stop} on the same square, they may join as one, or consume each other. This can be beneficial, but depends on the ghosts' relative coloration.

Any combination of primary colors (\textbf{r}ed, \textbf{y}ellow, \textbf{b}lue) will result in a secondary-colored ghost:
\begin{tabular}{|r| l}
	\textbf{r}ed \textbf{y}ellow & \textbf{o}range \\ \hline
	\textbf{y}ellow \textbf{b}lue & \textbf{g}reen \\ \hline
	\textbf{b}lue \textbf{r}ed & \textbf{v}iolet \\
\end{tabular}

Furthermore, an orange ghost will ignore red and yellow ghosts; a green ghost will ignore yellow and blue ghosts, and a violet ghost will not interact with blue or red ghosts.

It's worth noting that indigo ghosts will also ignore blue ones, seeing them as sufficiently similar to themselves.

When any other combination of colors meets, their mutual disgust for each other kills off one of them and leaves the other a lost and colorless husk. Avoid these interactions at all costs, and perform exorcisms (\textbf{\$kill}) liberally when they happen.


\end{document}