%!TEX root = main.tex
\def\figexamplesignfunctionscale{0.721}
\def\signsequencescale{0.721}
\newcommand\macropositivetile{
     \def\south{$-$}
     \def\east{$-$}
     \def\north{$+$}
     \def\west{$+$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\newcommand\macropositivetileBinary{
     \def\south{$0$}
     \def\east{$0$}
     \def\north{$1$}
     \def\west{$1$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\newcommand\macropositivetileBinarySouthOne{
     \def\south{$1$}
     \def\east{$1$}
     \def\north{$0$}
     \def\west{$0$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\newcommand\macronegativetile{
     \def\south{$+$}
     \def\east{$+$}
     \def\north{$-$}
     \def\west{$-$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\newcommand\macronegativetileBinary{
     \def\south{$1$}
     \def\east{$1$}
     \def\north{$0$}
     \def\west{$0$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\newcommand\macronegativetileBinarySouthOne{
     \def\south{$0$}
     \def\east{$0$}
     \def\north{$1$}
     \def\west{$1$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
%% begin plain snake graph 1011101100 or 2,3,1,2,3
% \begin{tikzpicture}[scale=\figexamplesignfunctionscale]%scale=0.5
% \foreach \x in {0,1,...,2} % bottom row 
% {
%     \draw (\x + 0, 0) -- (\x+1,0) -- (\x+1,1)-- (\x+0,1) -- cycle;
% }
%
%\def\y{1}
% \foreach \x in {2,...,5} % second from bottom row
% {
%     \draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
% } 
% 
%\def\y{2}
% \foreach \x in {5} % third from bottom row
% {
%     \draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
% }  
%
%\def\y{3}
%\foreach \x in {5,6} % fourth from bottom row
%{
%     \draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
% } 
% 
%\end{tikzpicture} % end plain snake graph 
%\caption{A snake graph with $10$ tiles}\label{fig:plain_snake_graph}
% begin snake graph 1011101100 or 2,3,1,2,3 where the label of the south edge is 0
 \begin{tikzpicture}[scale=\figexamplesignfunctionscale,font=\tiny]
 \foreach \x in {0,1,...,2} % bottom row 
 {
%     \draw (\x + 0, 0) -- (\x+1,0) -- (\x+1,1)-- (\x+0,1) -- cycle;
\def\y{0}
     \ifthenelse{\x = 0 \OR \x =2}
     {
     \macropositivetile
     }{
     \macronegativetile
     }
 }

\def\y{1}
 \foreach \x in {2,...,5} % second from bottom row
 {
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \ifthenelse{\x = 3 \OR \x =5}
     {\macropositivetile}{\macronegativetile}

 } 
 
\def\y{2}
 \foreach \x in {5} % third from bottom row
 {
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \macronegativetile
 }  

\def\y{3}
\foreach \x in {5,6} % fourth from bottom row
{
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \ifthenelse{\x = 5}
     {\macropositivetile}{\macronegativetile}
 } 
\end{tikzpicture}
\hspace{-5mm}
% begin snake graph 1011101100 or 2,3,1,2,3 (with 1 0 signs) where the south edge has label 0
 \begin{tikzpicture}[scale=\figexamplesignfunctionscale,font=\tiny]
 \foreach \x in {0,1,...,2} % bottom row 
 {
%     \draw (\x + 0, 0) -- (\x+1,0) -- (\x+1,1)-- (\x+0,1) -- cycle;
\def\y{0}
     \ifthenelse{\x = 0 \OR \x =2}
     {
     \macropositivetileBinary
     }{
     \macronegativetileBinary
     }
 }

\def\y{1}
 \foreach \x in {2,...,5} % second from bottom row
 {
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \ifthenelse{\x = 3 \OR \x =5}
     {\macropositivetileBinary}{\macronegativetileBinary}

 } 
 
\def\y{2}
 \foreach \x in {5} % third from bottom row
 {
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \macronegativetileBinary
 }  

\def\y{3}
\foreach \x in {5,6} % fourth from bottom row
{
     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
     \ifthenelse{\x = 5}
     {\macropositivetileBinary}{\macronegativetileBinary}
 } 
\end{tikzpicture}
\hspace{-5mm}
% % begin snake graph 1011101100 or 2,3,1,2,3 (with 1 0 signs) where the south edge has label 1
% \begin{tikzpicture}[scale=0.85,font=\tiny]
% 
%%       \ifthenelse{2 > 1}% 
%%         {\draw[ultra thick,blue,->] (0,0) -- (1*1,1*1);
%%          \foreach \x in {.0,.1,...,5} \draw[blue] 
%%                                    (1*\x,1*\x-\x*\x) circle (3pt);}{}
% 
% \foreach \x in {0,1,...,2} % bottom row 
% {
%%     \draw (\x + 0, 0) -- (\x+1,0) -- (\x+1,1)-- (\x+0,1) -- cycle;
%\def\y{0}
%     \ifthenelse{\x = 0 \OR \x =2}
%     {
%     \macropositivetileBinarySouthOne
%     }{
%     \macronegativetileBinarySouthOne
%     }
% }
%
%\def\y{1}
% \foreach \x in {2,...,5} % second from bottom row
% {
%     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
%     \ifthenelse{\x = 3 \OR \x =5}
%     {\macropositivetileBinarySouthOne}{\macronegativetileBinarySouthOne}
%
% } 
% 
%\def\y{2}
% \foreach \x in {5} % third from bottom row
% {
%     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
%     \macronegativetileBinarySouthOne
% }  
%
%\def\y{3}
%\foreach \x in {5,6} % fourth from bottom row
%{
%     %\draw (\x + 0, \y) -- (\x+1,\y) -- (\x+1,\y+1)-- (\x+0,\y+1) -- cycle;
%     \ifthenelse{\x = 5}
%     {\macropositivetileBinarySouthOne}{\macronegativetileBinarySouthOne}
% } 
%\end{tikzpicture}
% begin snake graph 1011101100 or 2,3,1,2,3 (with 1 0 signs in interior)
 \begin{tikzpicture}[scale=\signsequencescale,font=\scriptsize]
\def\macropositivetileBinaryFirstTileWestEast{
     \def\south{}
     \def\east{\textcolor{blue}{$0$}}
     \def\north{}
     \def\west{\textcolor{blue}{\underline{$1$}}}
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macropositivetileBinaryWestEast{
     \def\south{}
     \def\east{\textcolor{blue}{$0$}}
     \def\north{}
     \def\west{\textcolor{blue}{$1$}} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macropositivetileBinaryWestNorth{
     \def\south{}
     \def\east{}
     \def\north{\textcolor{blue}{$1$}}
     \def\west{\textcolor{blue}{$1$}} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macropositivetileBinarySouthEast{
     \def\south{\textcolor{blue}{$0$}}
     \def\east{\textcolor{blue}{$0$}}
     \def\north{}
     \def\west{} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macropositivetileBinarySouthNorth{
     \def\south{\textcolor{blue}{$0$}}
     \def\east{}
     \def\north{\textcolor{blue}{$1$}}
     \def\west{} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinary{
     \def\south{$1$}
     \def\east{$1$}
     \def\north{$0$}
     \def\west{$0$} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinaryWestEast{
     \def\south{}
     \def\east{\textcolor{blue}{$1$}}
     \def\north{}
     \def\west{\textcolor{blue}{$0$}}
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinaryWestNorth{
     \def\south{}
     \def\east{}
     \def\north{\textcolor{blue}{$0$}}
     \def\west{\textcolor{blue}{$0$}} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinarySouthEast{
     \def\south{\textcolor{blue}{$1$}}
     \def\east{\textcolor{blue}{$1$}}
     \def\north{}
     \def\west{} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinarySouthNorth{
     \def\south{\textcolor{blue}{$1$}}
     \def\east{}
     \def\north{\textcolor{blue}{$0$}}
     \def\west{} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}
\def\macronegativetileBinaryWest{ % for a last tile
     \def\south{}
     \def\east{}
     \def\north{}
     \def\west{\textcolor{blue}{$0$}} 
     \draw (\x + 0, \y) --  (\x+1,\y) node [pos=0.5,above] {\south} -- (\x+1,\y+1) node [pos=0.5,left] {\east} -- (\x+0,\y+1) node [pos=0.5,above] {\north} --  (\x + 0, \y)  node [pos=0.5,left] {\west};
}


 \foreach \x in {0,1,...,2} % bottom row 
 {
\def\y{0}
     \ifthenelse{\x = 0}{\macropositivetileBinaryFirstTileWestEast}{}
     \ifthenelse{\x = 1}{\macronegativetileBinaryWestEast}{}
     \ifthenelse{\x =2}{\macropositivetileBinaryWestNorth}{}
 }

\def\y{1}
 \foreach \x in {2,...,5} % second from bottom row
 {
     \ifthenelse{\x = 2}
     {\macronegativetileBinarySouthEast}{}
     \ifthenelse{\x = 3}
     {\macropositivetileBinaryWestEast}{}
     \ifthenelse{\x = 4}
     {\macronegativetileBinaryWestEast}{}
     \ifthenelse{\x = 5}
     {\macropositivetileBinaryWestNorth}{}
 } 
 
\def\y{2}
 \foreach \x in {5} % third from bottom row
 {
     \macronegativetileBinarySouthNorth
 }  

\def\y{3}
\foreach \x in {5,6} % fourth from bottom row
{
     \ifthenelse{\x = 5}{\macropositivetileBinarySouthEast}{}
     \ifthenelse{\x = 6}{\macronegativetileBinaryWest}{}
 } 
 
\end{tikzpicture}